How to handle errors / exception

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

2 Likes