Log.LinkCount Property

Applies to TestComplete 14.70, last modified on April 22, 2021

Description

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

Declaration

Log.LinkCount

Read-Only Property Integer

Applies To

The property is applied to the following object:

Property Value

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

Example

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

JavaScript, JScript

function LinkCount()
{
  // ...
  // Obtains the total number of link messages
  // posted to the test log
  var Num = Log.LinkCount;
  
  if ( Num > 0 )
    Log.Message("The test log contains " + Num + " link message(s).");
  else
    Log.Message("The test log contains no link messages.");
}

Python

def LinkCount():
  # ...
  # Obtains the total number of link messages
  # posted to the test log
  Num = Log.LinkCount
  if Num > 0:
    Log.Message("The test log contains " + str(Num) + " link message(s).")
  else:
    Log.Message("The test log contains no link messages.")

VBScript

Sub LinkCount()
  ' ...
  ' Obtains the total number of link messages
  ' posted to the test log
  Num = Log.LinkCount
  
  If Num > 0 Then
    Log.Message("The test log contains " & Num & " link message(s).")
  Else
    Log.Message("The test log contains no link messages.")
  End If

End Sub

DelphiScript

function LinkCount;
var Num;
begin

  // ...
  // Obtains the total number of link messages
  // posted to the test log
  Num := Log.LinkCount;
  
  if ( Num > 0 ) then
    Log.Message('The test log contains ' + Num + ' link message(s).')
  else
    Log.Message('The test log contains no link messages.');

end;

C++Script, C#Script

function LinkCount()
{
  // ...
  // Obtains the total number of link messages
  // posted to the test log
  var Num = Log["LinkCount"];
  
  if ( Num > 0 )
    Log["Message"]("The test log contains " + Num + " link message(s).");
  else
    Log["Message"]("The test log contains no link messages.");
}

See Also

Test Results
Link Method
FolderFileAndLinkCount Property
WrnCount Property
MsgCount Property
EvnCount Property
ImgCount Property
FileCount Property
ErrCount Property
FolderCount Method

Highlight search results