Log.ImgCount Property

Applies to TestComplete 14.0, last modified on January 23, 2019

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

About Test Log
Log.Picture Method
Log.FolderImgCount Property
Log.WrnCount Property
Log.MsgCount Property
Log.EvnCount Property
Log.ErrCount Property
Log.FileCount Property
Log.LinkCount Property
Log.FolderCount Method

Highlight search results