Once OnError command is executed all errors will be ignored?


Is there a way to set up that macro will not ignore error after OnError command was executed?

For example I want to run OnError goto command but then later in Macro I would like macro to simply stop on error or not to ignore the error and do run GOTO.



Currently you can not turn off OnError | #goto | label. But what you can do is to overwrite the label (jump target) with a new target. UI Vision will always use the target of the most recent OnError command that it encountered.

If you need to catch an error only in a certain section of your code use this:

  • store | true | !errorignore - start ignoring errors
  • store | true | !statusOK - make sure it is true
  • your code here…
  • GotoIf | ${!statusOK} == false | label - if there was an error in the code section above, then !statusOK is false now => jump to error processing
  • store | false | !errorignore - stop ignoring errors
  • more code… if you have an error now, the macro stops.