Forum Discussion

3 Replies

  • AlexKaras's avatar
    Champion Level 3



    Just a note to make sure you understand the difference between OnLogError event suggested by rraghvani and try/catch/finally code mentioned by tristaanogre :

    -- OnLogError will handle 'logical' script problems, for example, the click on the object that has zero size;

    -- try/catch/finally will handle runtime exceptions, like an attempt to use null object or divide by zero.


  • tristaanogre's avatar
    Esteemed Contributor

    Beyond the event handlers that rraghvani suggests, you could also go the route of using try/catch/finally code.  This is available both in keyword tests and in script code (depending upon your script language).  This will allow you to execute code on exceptions as well as a "finally" block to execute at the end of every test case.