My tests are running for long durtaion (more than 4 hrs).
Sometimes in between the test, test application crashes for different reasons.
I want to know when it has crashed and relaunch test application.
Is there a way to do it.
Also, after test application has crashed and relaunched i want test to continue from a predefined step. Can this be done in Test Complete
It is better to relaunch the AUT in between tests to eliminate crashing unless there is a requirement to launch only once.
Do you know when it gets a crash? like memory limit, session time, etc.
“You must expect great things from you, before you can do them”
: Do you know when it gets a crash? like memory limit, session time, etc.
: Usualy it crashes somewhere around 1 hour after starting the test , there is no particular step though.
I think memory must be one of the reason also.
With the crashed tested application, TestComplete should trigger log error because of inaccessibility of some UI control that test code will try to interact with right after the moment of crash.
So, you can create a handler for the OnLogError event and check there whether or not the application crashed and proceed appropriately. The exact check will depend on how application crashes. If its process has gone, then the check may be a simple verification for Sys.WaitProcess('<your tested application>', 500).Exists. If some crash dump window is displayed on crash, you may need to check for this window. And so on.
Note, that if you decide to restart your application from within the OnLogError event handler, than you must set a flag that you already is within the handler and exit from the handler if an error occurs while restarting the application. Otherwise you may appear within endless recurrent loop that will exaust system resources.
The bad news is that TestComplete does not provide any built-in means to restart the failed test item. Thus you must implement your own logic and execute it on start of every test item to determine if the current test item can be executed or not.
> Best way would be restart the application on every start of Testcase
This is a usual practice for the integration tests but I would say it is highly discussible in the case of complex end-to-end test that check if some task but not an operation with the binary result can be done.