Forum Discussion
The events do not fire for App crashes unless the test is coded to do so by checking for time outs, dialog windows or other things that indicate the app has crashed. These events are TestComplete events that fire for various things that TestComplete is set to check for, like log events, overlapping windows or unexpected windows. Using a Try, Catch, Finally in your test script should help. Then you can perform the actions you need to like checking if the app process exists or some other app object and then predicably and gracefully handle the application state with a consistent code structure.
https://support.smartbear.com/testcomplete/docs/reference/events/index.html
Cool tip for scripts: Using 'Ctrl j' will display a list box of script commands you can select from and TestComplete will add the stub code for what you need. :)
- SlickRick9 months agoFrequent Contributor
Hi Scot,
Sadly i already tried the try, catch, finally which was my first attempt at handling this case. The issue is that there is no real thrown errors. Just TestComplete not likely that the app suddenly got killed.
After further investigation, in our code we are closing using App.Exit but for some reason from time to time TC seems to detect it as a crash. Will continue to investigate.
Also in the doc it is explicitly mentioned (not sure how i skipped that) that this event wont be handled:
OnLogError Event | TestComplete Documentation
So i guess ill have to result to other alternative...
Ctrl j is indeed a cool tip which i was not aware of!