I'm new to Selenium. Below is my code.
<input type="submit" id="button" value="Edit"/>
I have 3 buttons with the same type, id and value. How do I click on each of the buttons? Can anyone help me with the XPath?
I resolved such problem in the following way:
String cssSelectorOfSameElements="input[type='submit'][id='button']";
List<WebElement> a=driver.findElements(By.cssSelector(cssSelectorOfSameElements)) ;
a.get(0).click();
//a.get(1).click();
//a.get(2).click();
depends upon what button you need to click on. Hope this works for you.