Forum Discussion

rushikesh's avatar
rushikesh
Contributor
6 years ago

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

  • shankar_r's avatar
    shankar_r
    Community Hero

    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.

    • rushikesh's avatar
      rushikesh
      Contributor

      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. 

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        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.

         

  • anupamchampati's avatar
    anupamchampati
    Frequent Contributor
    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
    • AlexKaras's avatar
      AlexKaras
      Champion Level 3

      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.