Log.MsgCount Property

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

Description

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

Declaration

Log.MsgCount

Read-Only Property Integer

Applies To

The property is applied to the following object:

Property Value

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

Example

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

JavaScript, JScript

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

Python

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

VBScript

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

End Sub

DelphiScript

function MsgCount;
var Num;
begin

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

end;

C++Script, C#Script

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

See Also

Test Results
Message Method
FolderMsgCount Property
WrnCount Property
ErrCount Property
EvnCount Property
ImgCount Property
FileCount Property
LinkCount Property
FolderCount Method

Highlight search results