Button with dynamic ID and same name across page how do I just click on the button I need | Selenium Forum
L
lalithaa84 Posted on 07/04/2019
For example the button I need to click has xpath of //*[@id="button-1456-btnInnerEl"] , only the number '1456' is varying across various buttons across page. There are more buttons on same page with same name and similar ID only number is varying if I use contains functionality like //span[contains (@id, 'button')] or //span[contains (@id, 'btnInnerEl')] , get so many of them identified. Could you please help me on this or point to the correct example?

A
Ashish Thakur Replied on 09/04/2019

You may need to retrieve the parent element of that button first