cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to launch test application back again if it crashes during test execution.

Contributor

Is there a way to launch test application back again if it crashes during test execution.

Hi

 

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 

6 REPLIES 6
Community Hero

Re: Is there a way to launch test application back again if it crashes during test execution.

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.


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”


Extension Available

Contributor

Re: Is there a way to launch test application back again if it crashes during test execution.

@shankar_r 

 

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

Community Hero

Re: Is there a way to launch test application back again if it crashes during test execution.

Hi,

 

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.

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members 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. Postings made by [Community Expert Group] members
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.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Contributor

Re: Is there a way to launch test application back again if it crashes during test execution.

General Event on log :
1. check for the log.testitem name if it is not project. last item by some count as a check
2. Simply write a function to check whether sys.process applicationname exists and if not run the application and run the remaining testitem from project.testitems

Best way would be restart the application on every start of Testcase
Community Hero

Re: Is there a way to launch test application back again if it crashes during test execution.

Hi,

 

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

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members 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. Postings made by [Community Expert Group] members
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.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Community Manager

Re: Is there a way to launch test application back again if it crashes during test execution.

Thanks everybody for sharing your suggestions!

@rushikesh, did you find a solution?

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
New Here?
Join us and watch the welcome video:
6 / 7 API Testing Mistakes Video
Top Kudoed Authors