I was doing same thing earlier what you suggested. But that piece of code or line will only get executed when test is passed successfully.
If in between (before that revert code), the test fails, the system will be not in proper state as the changes i did while test execution, it would still be there. Because of this reason, i was trying to use OnStopTestCase event handler, so that i could revert the changes irrespective of test passed or failed.
Let me know if there is any alternative way to do this. I have used Selenium before and in that we have option to do teardown. I was hoping similar kind of thing would be present in TestComplete.
Regards, /Alex [Community Hero] ____ [Community Heroes] are not employed by SmartBear Software but are just volunteers who have some experience with the tools by SmartBear Software and a desire to help others. Posts made by [Community Heroes] may differ from the official policies of SmartBear Software and should be treated as the own private opinion of their authors and under no circumstances as an official answer from SmartBear Software. The [Community Hero] signature is used with permission by SmartBear Software. https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame ================================
Thank you for providing a sample code. The logic makes sense, however when i was using Exit procedure, it is not working. It is giving error as not defined in python. Does it not work with python language?
Also, how to call this exit, i am just using Exit() to call this procedure. Let me know if this is not the right way.