Forum Discussion

nimishbhuta's avatar
nimishbhuta
Frequent Contributor
7 years ago

How to perform post activities if my test is interrupted for any reason?

Hello All, 

 

I have issue that if the test is interrupeted or stopped due to some reason, I need to run some post activities such as updating my reports, closing the application etc. 

 

Is there any way we can trigger this post activites?

 

Regards,

 

Nimish

3 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi Nimish,

     

    At least three options can be suggested. Their applicability to your case depends on your tests architecture.

    a) Try/Catch functionality of the given scripting language (if supported);

    b) OnLogError/OnTestStop event in TestComplete;

    c) If your tests are executed from command line (e.g. when triggered from some CI system like Jenkins), you may use TestComplete exit code and trigger this or that action/program/batch file.

  • nimishbhuta's avatar
    nimishbhuta
    Frequent Contributor

    Thanks for your reply. 

     

    It seems that the 2nd option especially the OnStopTest event will be applicable based on my test architecture. 

     

     

    I have gone through the onStopTest event documentation but did not find any good example to implement it. 

     

    Can you let me know, how can I implement it ?  I am using Vbscript as my scriping language.

     

    Regards,

     

    Nimish