Log.ImgCount Property

Applies to TestComplete 15.70, last modified on December 17, 2024

Description

Returns the number of image messages (that is, messages added via Log.Picture) posted to the test log during the current run of the current test item.

Declaration

Log.ImgCount

Read-Only Property Integer

Applies To

The property is applied to the following object:

Property Value

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

Example

The code below obtains the total number of images that were posted to the test log by the current test item and then posts this number to the test log.

JavaScript, JScript

function ImgCount()
{
  // ...
  // Obtains the total number of images
  // posted to the test log
  var Num = Log.ImgCount;

  if ( Num > 0 )
    Log.Message("The test log contains " + VarToStr(Num) + " image(s).");
  else
    Log.Message("The test log contains no images.");
}

Python

def ImgCount():
  # ...
  # Obtains the total number of images
  # posted to the test log
  Num = Log.ImgCount
  if Num > 0:
    Log.Message("The test log contains " + VarToStr(Num) + " image(s).")
  else:
    Log.Message("The test log contains no images.")

VBScript

Sub ImgCount
  ' ...
  ' Obtains the total number of images
  ' posted to the test log
  Num = Log.ImgCount

  If Num > 0 Then
    Log.Message("The test log contains " & Num & " image(s).")
  Else
    Log.Message("The test log contains no images.")
  End If

End Sub

DelphiScript

procedure ImgCount;
var Num;
begin

  // ...
  // Obtains the total number of images
  // posted to the test log
  Num := Log.ImgCount;

  if ( Num > 0 ) then
    Log.Message('The test log contains ' + Num + ' image(s).')
  else
    Log.Message('The test log contains no images.');

end;

C++Script, C#Script

function ImgCount()
{
  // ...
  // Obtains the total number of images
  // posted to the test log
  var Num = Log["ImgCount"];

  if ( Num > 0 )
    Log["Message"]("The test log contains " + Num + " image(s).");
  else
    Log["Message"]("The test log contains no images.");
}

See Also

Test Results
Picture Method
FolderImgCount Property
WrnCount Property
MsgCount Property
EvnCount Property
ErrCount Property
FileCount Property
LinkCount Property
FolderCount Method

Highlight search results