private void select(WebDriver driver, String select_text) {
System.out.println("Selecting "+select_text+" from drop down menu");
Select select = new Select(driver.findElement(By.name("roomMenu")));
select.selectByVisibleText(select_text);
}
This function works fine with firefox, but when running in IE, it doesn't click on any option. Is there a specific way I have to do it for IE?
EDIT:
I rewrote it without using the Select object and it still refuses to click the option.
private void select(WebDriver driver, String select_text) {
System.out.println("Selecting "+select_text+" from drop down menu");
WebElement select = driver.findElement(By.name("roomMenu"));
List<WebElement> options = select.findElements(By.tagName("option"));
for (WebElement option : options) {
if (option.getText().equals(select_text)) {
System.out.println(option.getText());
option.click();
}
}
}
It prints out the correct option so I know it found the right one, but when I do option.click() nothing happens in IE.