Log.CheckpointCount Property

Applies to TestComplete 15.69, last modified on November 13, 2024

Description

Returns the number of checkpoint messages (that is, messages added via the Log.Checkpoint method or returned by any checkpoint operation) posted to the test log during the current run of the current test item.

Declaration

Log.CheckpointCount

Read-Only Property Integer

Applies To

The property is applied to the following object:

Property Value

An integer value that indicates the number of checkpoint messages in the test log.

Example

The code below obtains the total number of checkpoint messages posted to the test log and then checks whether this number is not null.

JavaScript, JScript

function CheckpointCount()
{
  // ...
  
  // Obtains the total number of checkpoint messages
  // posted to the current test log
  var CheckCount = Log.CheckpointCount;
  
  // Checks whether there are some checkpoint messages
  if ( CheckCount > 0 )
    Log.Message("There is(are) " + CheckCount + " checkpoint message(s) in the test log.")
  else
    Log.Message("There are no checkpoint messages in the test log.");
}

Python

def CheckpointCount():
  # ...
  # Obtains the total number of checkpoint messages 
  # posted to the current test log
  CheckCount = Log.CheckpointCount
  # Checks whether there are some checkpoint messages
  if CheckCount > 0:
    Log.Message("There is(are) " + str(CheckCount) + " checkpoint message(s) in the test log.")
  else:
    Log.Message("There are no checkpoint messages in the test log.")

VBScript

Sub CheckpointCount()

  ' ...
  
  ' Obtains the total number of checkpoint messages
  ' posted to the current test log
  CheckCount = Log.CheckpointCount
  
  ' Checks whether there are some checkpoint messages
  If CheckCount > 0 Then
    Log.Message("There is(are) " & CheckCount & " checkpoint message(s) in the test log.")
  Else
    Log.Message("There are no checkpoint messages in the test log.")
  End If
  
End Sub

DelphiScript

function CheckpointCount;
var CheckCount;
begin

  // ...
  
  // Obtains the total number of checkpoint messages
  // posted to the current test log
  CheckCount := Log.CheckpointCount;
  
  // Checks whether there are some checkpoint messages
  if ( CheckCount > 0 ) then
    Log.Message('There is(are) ' + CheckCount + ' checkpoint message(s) in the test log.')
  else
    Log.Message('There are no checkpoint messages in the test log.');

end;

C++Script, C#Script

function CheckpointCount()
{
  // ...
  
  // Obtains the total number of checkpoint messages
  // posted to the current test log
  var CheckCount = Log["CheckpointCount"];
  
  // Checks whether there are some checkpoint messages
  if ( CheckCount > 0 )
    Log["Message"]("There is(are) " + CheckCount + " checkpoint message(s) in the test log.")
  else
    Log["Message"]("There are no checkpoint messages in the test log.");
}

See Also

Test Results
Checkpoint Method
ErrCount Property
WrnCount Property
MsgCount Property
EvnCount Property
ImgCount Property
FileCount Property
LinkCount Property
FolderCount Method

Highlight search results