Forum Discussion

nbenitus's avatar
nbenitus
Contributor
15 years ago

How to get the status of the last operation

Hi,


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,


Benoit

1 Reply


  • 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.