Error handling for click commands

Hello!

I'm looking for some help with error handling for click commands. I use TB to click the same button over and over again within a webpage for writing notes in medical charts.

My issue is when the button isn't present in one line, instead of going to the next one, the snippet fails. I'm wondering how I can tell it to skip that button and keep going.

I've tried the try/catcherror functions and can't get it to work; it still says the click command did not match any interactive element.

Any help would be appreciated. Thank you!

Hi Bari,

There isn't a way to disable that error currently. One option you can do is wrap the command in an {if} statement that checks if the element is in the page and only clicks if it is.

For example, something like this might work:

{if: catch({site: selector=.my-element}, "missing") <> "missing"}{click: selector=.my-element}{endif}