My question is whether it's possible to attempt a click action on a button, and if the button is not present on the page, have the test skip that action without getting stuck or throwing an error, and continue to the next one. To provide more context, I am working with a modal where I can add rows to a table. My goal is to only add a new row if a specific button in the modal is not available. If the button is present, the desired action would be to click on it before adding a new row.
I'm wondering if this scenario is achievable as I prefer to avoid using conditional statements in my tests. Your assistance on this matter would be greatly appreciated. Thank you in advance :)