Friday, 17 July 2015

select an item from a dropdown list using Selenium WebDriver

List<WebElement> options = select.findElements(By.tagName("option"));

for (WebElement option : options) {

if("Germany".equals(option.getText().trim()))

 option.click();   
}

No comments:

Post a Comment