How to access the second element that has the same class name in selenium using java

java, selenium, selenium-webdriver

Solution

You can use xpath indexing option.

By.xpath("(//input[@name='Button'])[2]")

Problem

When trying to automate our application, there are two buttons with same name. I'm not able to find a way to recognize these. Please let me know what could be the other ways to identify these elements in selenium webdriver in java

Original source

Related problems