void select(String name, String value) {
WebElement element = By.name(name);
List<WebElement> options = element.findElements(By.tagName("option"));
for (WebElement option : options) {
if (option.getText().equals(value)) {
option.click();
return;
}
}
}
|