What to do when an unexpected error occurs in a script?

Support
  • Except "Ignore Errors" action, is there any other way of handling a random error in a script?
    I'm referring to those errors that appear at random steps in the script and they are rare or hard to anticipate. Or when the script has to make tens of clicks on various elements on multiple pages, and setting an "Ignore Errors" action for each of them is too complicated. I'd like to know if there is a general action that can be set to do something when such a random/ unexpected error appears in a script (like if at some point the script cannot find an element, then it should save this error in an xlsx file).
    Thank you

  • @aronax said in What to do when an unexpected error occurs in a script?:

    Except "Ignore Errors" action, is there any other way of handling a random error in a script?
    I'm referring to those errors that appear at random steps in the script and they are rare or hard to anticipate. Or when the script has to make tens of clicks on various elements on multiple pages, and setting an "Ignore Errors" action for each of them is too complicated. I'd like to know if there is a general action that can be set to do something when such a random/ unexpected error appears in a script (like if at some point the script cannot find an element, then it should save this error in an xlsx file).
    Thank you

    Put all actions in a function, and wrap its call in ignoring errors. Any error in the function will trigger error ignoring.

  • 0 Votes
    3 Posts
    653 Views
  • 0 Votes
    10 Posts
    1715 Views
  • can you develop the same script?

    Locked Support
    -1 Votes
    1 Posts
    538 Views
  • Substring giving me errors

    Support
    0 Votes
    9 Posts
    2186 Views
  • 1 Votes
    2 Posts
    1149 Views