How to handle errors / exception


#1

In our application we get jav exceptions, how to handle if we get that ?
Like I want to take screenshot and re run the test.

And one more scenario: Session time out, it should auto login.


[Recreator Required] [BUG] => Test case for debugging needed] Script freezes unexpectedly with no error written to log. Manual pause/resume brings it back
#2

There are two different ways:

(1) Inside the macro

  • If you just want to continue despite an error, use store | true | !errrorignore

  • To make an if/then decision, for example to try again or take screenshot in case of an error, or even to re-run the complete test, use If | ${!statusOK} The value of !statusOk tells you if the previous command worked ok.

  • Other commands you can use are GotoIf and While

(2) Outside a macro, e. g. from a calling PowerShell or Python script

=> Check the macro status as written in the first line of the log file. The file is created when you start the macor with the savelog=1 option

Example code for controlling Kantu from the command line