Forum Discussion

xikotejat's avatar
xikotejat
Visitor
6 years ago

Run script on fail

Hello everyone,

 

does anyone know how to make TestComplete run specified script (e.g. app termination) if testcase fails. Thank you in advance!

 

Regards,

Said

 

1 Reply

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    There are many ways to do this, depending upon your configuration... probably the most "obvious" is to utilize an event handler.  There are several available in TestComplete including, but not limited to, "OnStopTest", "OnLogError", and "OnLogWarning".  Do a search of the online help documentation to understand how to implement these.

     

    Additionally, within your automation, you could implement "try/catch/finally" logic to detect fail points and, when something errors out, handle the situation in the "finally" block of code.

     

    There are probably other ways of doing this, but these are the two that are probably the most common ways of solving this problem.

     

    If you need specific help in implementing these, please let us know and we'll see what we can do.