Log.FolderCheckpointCount Property

Applies to TestComplete 14.72, last modified on December 24, 2020

Description

Returns the number of checkpoint messages (messages added via the Log.Checkpoint method or via checkpoints) posted to the specified log folder and all of its subfolders during the current test item run.

Declaration

Log.FolderCheckpointCount(FolderID)

Read-Only Property Integer
FolderID [in]    Required    Integer    

Applies To

The property is applied to the following object:

Parameters

The property has the following parameter:

FolderID

The identifier of the needed log folder. To get the folder's identifier, use the Log.CreateFolder method.

Property Value

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

Example

The code below creates a new folder in the test log, then, at the end of the test, obtains the total number of checkpoint messages in this folder and posts this number to the test log.

JavaScript, JScript

function CheckpointCountExample()
{
  // Creates a new folder in the test log
  var FoldID = Log.CreateFolder("MyNewFolder");
  Log.PushLogFolder(FoldID);
  Log.Checkpoint("Test checkpoint");
  // ...
  Log.PopLogFolder();
  // ...
  // Obtains the number of checkpoints in the folder
  var Num = Log.FolderCheckpointCount(FoldID);
  
  // Checks whether the folder contains checkpoints
  if ( Num > 0 )
    Log.Message("The folder contains " + Num + " checkpoint(s).");
  else
    Log.Message("The folder contains no checkpoints.");
}

Python

def CheckpointCountExample():
  # Creates a new folder in the test log
  FoldID = Log.CreateFolder("MyNewFolder")
  Log.PushLogFolder(FoldID)
  Log.Checkpoint("Test checkpoint")
  # ...
  Log.PopLogFolder()
  # ...
  # Obtains the number of checkpoints in the folder 
  Num = Log.FolderCheckpointCount[FoldID]
  # Checks whether the folder contains checkpoints
  if Num > 0:
    Log.Message("The folder contains " + str(Num) + " checkpoint(s).")
  else:
    Log.Message("The folder contains no checkpoints.")

VBScript

Sub CheckpointCountExample()

  ' Creates a new folder in the test log
  FoldID = Log.CreateFolder("MyNewFolder")
  Log.PushLogFolder(FoldID)
  Log.Checkpoint("Test checkpoint")
  ' ...
  Log.PopLogFolder()
  ' ...
  ' Obtains the number of checkpoints in the folder
  Num = Log.FolderCheckpointCount(FoldID)
  
  ' Checks whether the folder contains checkpoints
  If Num > 0 Then
    Log.Message("The folder contains " & Num & " checkpoint(s).")
  Else
    Log.Message("The folder contains no checkpoints.")
  End If
  
End Sub

DelphiScript

function CheckpointCountExample;
var FoldID, Num;
begin

  // Creates a new folder in the test log
  FoldID := Log.CreateFolder('MyNewFolder');
  Log.PushLogFolder(FoldID);
  Log.Checkpoint('Test checkpoint');
  // ...
  Log.PopLogFolder();
  // ...
  // Obtains the number of checkpoints in the folder
  Num := Log.FolderCheckpointCount(FoldID);
  
  // Checks whether the folder contains checkpoints
  if ( Num > 0 ) then
    Log.Message('The folder contains ' + Num + ' checkpoint(s).')
  else
    Log.Message('The folder contains no checkpoints.');

end;

C++Script, C#Script

function CheckpointCountExample()
{
  // Creates a new folder in the test log
  var FoldID = Log["CreateFolder"]("MyNewFolder");
  Log["PushLogFolder"](FoldID);
  Log["Checkpoint"]("Test checkpoint");
  // ...
  Log["PopLogFolder"]();
  // ...
  // Obtains the number of checkpoints in the folder
  var Num = Log["FolderCheckpointCount"](FoldID);
  
  // Checks whether the folder contains checkpoints
  if ( Num > 0 )
    Log["Message"]("The folder contains " + Num + " checkpoint(s).");
  else
    Log["Message"]("The folder contains no checkpoints.");
}

See Also

Test Results
Checkpoint Method
CheckpointCount Property
FolderErrCount Property
FolderWrnCount Property
FolderMsgCount Property
FolderEvnCount Property
FolderImgCount Property
FolderFileAndLinkCount Property
FolderCount Method
CreateFolder Method

Highlight search results