Hi I have two types of add buttons which are displaying in the webpage dynamically,
I wrote code like below
try
click add1 button
catch Exception
click add2 button
But the script some times fails when it is trying to click add1 button and in the web page currently it is displaying add2 button, the execution flow is not going to catch block when add1 button is not found
Can anyone help me how to write a logic where i want to click add button in the web page , but the web page displaying dynamically some time one locator i.e. add1 button sometime another locator add2 button