Ask a Question

How to get the status of the last operation


How to get the status of the last operation


I am trying to obtain the status of the last operation that was performed, such as:

- Keyboard input

- Unexpected window

- Object does not exist

I would use that in an if statement such as:

if (<last_operation_result> = "Unexpected window") Then Do Something

Thanks in advance,


RE: How to get the status of the last operation

Hi Benoit,

You can obtain text posted to the test log from the LogParams parameter of the OnLogEvent, OnLogMessage, OnLogError and other OnLog* events. These events are fired before TestComplete posts a message of the corresponding type to the test log. To learn about these events and how to handle them, see the "About Events and Event Handling", "OnLogEvent Event", "OnLogMessage Event", "OnLogError Event" help topics and other help topics corresponding to the OnLog* events.

BTW, you can handle unexpected windows by using the OnUnexpectedWindow event handler. For details, see the "OnUnexpectedWindow Event" help topic.
Dmitry Nikolaev

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Showing results for 
Search instead for 
Did you mean: