Log.FolderCount Method

Applies to TestComplete 15.63, last modified on April 23, 2024

Description

Returns the number of folders created in the test log via Log.CreateFolder during the current run of the current test item.

Declaration

Log.FolderCount()

Result Integer

Applies To

The method is applied to the following object:

Result Value

An integer value that means the number of folders in the test log.

Example

The code below creates a new folder in the test log, then obtains the total number of folders created by the current test item and posts this number to the test log.

JavaScript, JScript

function FolderCountExample()
{
  // Creates a new folder in the test log
  var FoldID = Log.CreateFolder("MyNewFolder");
  Log.PushLogFolder(FoldID);
  Log.Checkpoint("Test checkpoint");
  // ...
  Log.PopLogFolder();
  // ...
  // Obtains the total number of folders
  // created by the test item
  var Num = Log.FolderCount();
  // Posts this number to the test log
  Log.Message("The number of folders created by this test item: " + Num);
}

Python

def FolderCountExample():
  # Creates a new folder in the test log
  FoldID = Log.CreateFolder("MyNewFolder")
  Log.PushLogFolder(FoldID)
  Log.Checkpoint("Test checkpoint")
  # ...
  Log.PopLogFolder()
  # ...
  # Obtains the total number of folders
  # created by the test item
  Num = Log.FolderCount()
  # Posts this number to the test log
  Log.Message("The number of folders created by this test item: " + str(Num))

VBScript

Sub FolderCountExample()

  ' Creates a new folder in the test log
  FoldID = Log.CreateFolder("MyNewFolder")
  Log.PushLogFolder(FoldID)
  Log.Checkpoint("Test checkpoint")
  ' ...
  Log.PopLogFolder()
  ' ...
  ' Obtains the total number of folders
  ' created by the test item
  Num = Log.FolderCount
  ' Posts this number to the test log
  Log.Message("The number of folders created by this test item: " & Num)
  
End Sub

DelphiScript

function FolderCountExample;
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 total number of folders
  // created by the test item
  Num := Log.FolderCount;
  // Posts this number to the test log
  Log.Message('The number of folders created by this test item: ' + aqConvert.IntToStr(Num));

end;

C++Script, C#Script

function FolderCountExample()
{
  // Creates a new folder in the test log
  var FoldID = Log["CreateFolder"]("MyNewFolder");
  Log["PushLogFolder"](FoldID);
  Log["Checkpoint"]("Test checkpoint");
  // ...
  Log["PopLogFolder"]();
  // ...
  // Obtains the total number of folders
  // created by the test item
  var Num = Log["FolderCount"]();
  // Posts this number to the test log
  Log["Message"]("The number of folders created by this test item: " + Num);
}

See Also

Test Results
CreateFolder Method
ErrCount Property
MsgCount Property
EvnCount Property
ImgCount Property
FileCount Property
LinkCount Property
FolderErrCount Property
FolderWrnCount Property
FolderMsgCount Property
FolderEvnCount Property
FolderImgCount Property
FolderFileAndLinkCount Property

Highlight search results