Forum Discussion

ahmed_daniel's avatar
ahmed_daniel
Occasional Contributor
10 years ago

Resuming test to next test item after application crash

Hi,   I am using TestComplete to run a couple of different tests on a single desktop application. The application is prone to crashes so I want to ask is it possible to resume test to next test ite...
  • AlexKaras's avatar
    AlexKaras
    10 years ago

    Hi Daniel,

     

    The actual implementation depends on your tested application (Desktop / Web / Mobile) and the way how it crashes (process disappears / some window is shown and the process is terminated after this window is closed / etc.), but I think that I would try something like that (refer to the help system for the description and more information about terms that are not clear or ask questions here):

    -- Implement a handler for the OnLogError or OnTestStart or OnTestStop events whatever is more reasonable in your given case;

    -- Implement some global flag (as a temporary Project Variable) that indicates whether or not the tested application is expected to be running (with absent crash indications) -- this is for the case when you need to do something regardless of whether or not application is running;

    -- Create a code called from the event handler that will check (using the above flag) if the tested application is running (when it is expected to be running) and if the crash indicators are present or not. The result of these checks is a decision whether or not application crash happened. If the application crashed and need to be restarted, then the code must perform all required clean-up actions (e.g. close crash notification window with a proper logging) and restart the tested application.

     

    Note, that, depending on your application, it will be restarted either in its initial state or in the state it was at the moment of crash. If the former, than, obviously, your tests must not expect that the application is in some expected state, but might be in its initial state and behave appropriately. In order to ease this task, you may consider Stop On Error and Stop on Exception properties of the test items (http://support.smartbear.com/viewarticle/55015/).