OnLogError Event

Applies to TestComplete 15.70, last modified on December 17, 2024

Occurs before an error message is posted to the test log.

Declaration

OnLogError(SenderLogParams) Parameters
Sender [in] Required Variant
LogParams [in] Required A LogParams object

Description

The event occurs before an error message is posted to the test log. You can use this event to perform desired actions when an error message is posted to the log.

For information on how to create an event handler for this and other TestComplete events, see Handling Events.

Parameters

The event has the following parameters:

Sender

The Event control that processes the event.

LogParams

The properties of the LogParams object hold node attributes. You can use the LogParams.MessageText property to replace the TestComplete text with your own.

To avoid recurring calls, do not use the Log.Error method within the event handler of the OnLogError event.

Remarks

The OnLogError event is only generated for errors that occur when calling methods of TestComplete program objects. For example, this event is raised when you call Log.Error to post the error message manually, or when you call a property or a method of a tested object that currently does not exist in the system.

The OnLogError event is not raised for:

  • Exceptions. Exceptions can occur in the application under test and also can occur due to errors in the script code. For information on how to handle these exceptions, see Handling Exceptions in Scripts.

  • The … process crashed” error.

  • The … process does not respond. It will be terminated” error.

Do not call the Run method of the NetworkSuite, Job and Task objects from the event handler. Otherwise, an error will occur.

In addition, do not call the NetworkSuite.Synchronize method from the event handler. The method will always return False.

See Also

Posting Messages to the Log
LogParams Object
OnLogMessage Event
OnLogWarning Event
OnLogEvent Event
OnLogCheckpoint Event
OnLogPicture Event
OnLogFile Event
OnLogLink Event
Handling Events
Event Control

Highlight search results