I ask for a hand to be able to click a button with webdriver.findelement; the problem is that in the html the two buttons are identical in all properties and I cannot understand how to choose between the 2. The only field that changes is aria-labeledby but it changes at each refresh and therefore it is impossible to capture it with findElement . I leave the images of the code of the two buttons below. The tags are contained in a span, which has the usual characteristics for both buttons. enter image description here
C # Selenium problem to click a button with webdriver when there are 2 identical buttons on the page
Asked
Active
Viewed 67 times
-1
-
can you share a link to that page or give us entire HTML code of that page as a text, not as a picture? – Prophet Feb 18 '22 at 09:57
-
Please do not post images of code. Instead, [edit] your question to include the code as plain text formatted in code blocks. Be sure to include a [repro]. – Greg Burghardt Feb 28 '22 at 19:31
1 Answers
0
With the limited amount of information it is hard to say for sure, but in this event I would normally try xpath or full xpath. You didnt specify what you gave find element to use but Xpath should work.

Isaac M
- 56
- 4