Applies to TestComplete 14.30, last modified on November 21, 2019

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
Log.Message Method
Log.FolderMsgCount Property
Log.WrnCount Property
Log.ErrCount Property
Log.EvnCount Property
Log.ImgCount Property
Log.FileCount Property
Log.LinkCount Property
Log.FolderCount Method

Highlight search results