Log Message Operation

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

Description

Use the Log Message operation to post messages of the error, warning, event and information types to the test log.

Operation Result

The operation does not return any value.

Scripting Analogue

The actions, which the operation performs, are analogues to the actions that are performed by the Log.Message, Log.Error, Log.Warning and Log.Event methods.

Child Operations

The operation cannot have child operations.

Operation Parameters

The operation parameters are organized into the following pages:

Message Details

On the Message Details page you can specify the frequently used parameters of the operation.

Message Type

Specifies the type of the message to be posted to the test log.

Message

Specifies the message’s text. This text will be displayed in the Message column of the test log.

Additional Information

Specifies additional information to be posted to the log along with the message. This information will be displayed in the Details panel of the log when the message is selected.
Operation Parameters

On this page you can modify all of the parameters of the operation:

MessageText

The message text. This is the value that you specified in the Message edit box of the Message Details page. MessageText can hold data of any OLE-compatible type. If it cannot be converted to text, its value is ignored. To learn more about adding a variable value to the test log, see Posting Messages to the Log.

AdditionalText

Additional text to be displayed in the Details pane of the test log (this is the same value that you specified in the Additional Info edit box of the Message Details page). AdditionalText can hold data of any type compatible with OLE. If it cannot be converted to text, its value is ignored.

The AdditionalText parameter can also hold HTML code. The test engine will compile the HTML page and display it in the Details pane. For more information, see Posting Messages to the Log.

Priority

Message priority. You can use any integer number or any of the following constants:

Constant Value Description
pmLowest 100 The lowest priority of the message.
pmLower 200 The message priority which is lower than normal.
pmNormal 300 The normal (default) priority of the message.
pmHigher 400 The message priority which is higher than normal.
pmHighest 500 The highest priority of the message.

For information on specifying the Priority parameter value, see Specifying Enumeration Values in Parameters.

Attrib

The LogAttributes object that contains the font and color attributes to be applied to the message in the test log.

You can create this object by using the Log Attributes operation or script code. In the latter case, to specify the parameter, you should use a script expression that returns a reference of the LogAttributes object or use a variable, test parameter or [Last Operation Result] that contains the object reference.

If this parameter is omitted, default attributes will be applied.

Picture

Specifies the image to be posted to the test log along with the message. This image will be displayed in the Picture pane of the Test Log when the message is selected in the test log.

To specify the parameter, you can use one the following values:

  • The [Onscreen Object] value that corresponds to the window, whose image you want to post to the log.

  • A string constant that specifies the path to the file that holds the image to be posted to the log.

  • Either [Variable], [Test Parameter], [Code Expression] or [Last Operation Result] values that contain one of the following data:

    • A reference to the Picture object, which corresponds to the desired picture.
    • An object that has the Picture method, which returns the desired Picture object.
    • A string that contains the path to the file that holds the image to be posted to the log.

FolderID

Identifier of the test log’s folder to which the message will be posted. This can be, for instance, the identifier of the folder created by the previous Append Log Folder operation, or the identifier returned by the Log.CreateFolder scripting method.

If this parameter refers to a non-existent folder, is omitted or is set to -1 (the default value), the operation will post the message to the currently active folder.

Remarks

The Log Message operation posts informative, error, warning and event messages to the log. To post messages of the image type (for instance, images of the application windows), use the Post Screenshot operation.

For information on values that can be used to set the operation properties, see Specifying Operation Parameters.

See Also

Logging Category
Specifying Operation Parameters
Checking Operation Result
Posting Messages to the Log
Message Method
Error Method
Warning Method
Event Method
Post Screenshot Operation
Append Log Folder Operation
Log Attributes Operation

Highlight search results