cancel
Showing results for 
Search instead for 
Did you mean: 

Stop TestComplete execution if application under test crashes

SOLVED
New Contributor

Stop TestComplete execution if application under test crashes

Hi SmartBear Community,

 

I think my question is very simple but not so easy to understand.
If the application under test crashes, TestComplete should either stop the test completely or switch to the next test item.
The situation is as follows:
1. the application under test is started
2. several things are done in the application
3. an error occurs suddenly and the application is completely closed without any error message or other hints and the process is terminated. I.e. it no longer exists in the Windows system.
The problem is now, that TestComplete doesn't notice any of this and the test execution simply continues.

This means that one error comes after the other.
In this case, however, the test execution should simply be stopped.
Please do not send me the link with the SmartBear Support page where the topic "Tracing Exceptions, Crashes and Freezes" is covered. This doesn't help in case of a crash! Also in case of a crash the LogOnError event is not triggered.

To add a check in several places in KeywordTests/Scripts would be a solution I would like to avoid!
Is it still technically possible to do this in TestComplete?

 

best regards and many thanks

Klaus

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: Stop TestComplete execution if application under test crashes

While the application crash is not detected, I'm assuming that there are other errors that occur after the crash, usually object identification errors of sorts.

 

I would still suggest using OnLogError event handler.  What you could do is, in that event handler, add a check for if (!Sys.WaitProcess('myapp').Exists) then to detect if the process is present.  If it is not, you can call Runner.Stop() and kill the whole test run.

An alternative: In TestComplete 14, under Tools -> Current Project Properties -> Playback there's an On object recognition error setting that you can set to Stop Project which will halt the whole run if an object recognition error occurs. 


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
2 REPLIES 2
Highlighted
Community Hero

Re: Stop TestComplete execution if application under test crashes

While the application crash is not detected, I'm assuming that there are other errors that occur after the crash, usually object identification errors of sorts.

 

I would still suggest using OnLogError event handler.  What you could do is, in that event handler, add a check for if (!Sys.WaitProcess('myapp').Exists) then to detect if the process is present.  If it is not, you can call Runner.Stop() and kill the whole test run.

An alternative: In TestComplete 14, under Tools -> Current Project Properties -> Playback there's an On object recognition error setting that you can set to Stop Project which will halt the whole run if an object recognition error occurs. 


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
New Contributor

Re: Stop TestComplete execution if application under test crashes

Thank you very much for that detailed answer!

New Here?
Join us and watch the welcome video:
Top Kudoed Authors