Trying to select from multi-select dropdown box and found what seemed to be a good resource.
I am working on http://preview.harriscountyfws.org/ I am trying to Select multiple items on the "Select by Agency" mutli-select dropdown.
The logic I show you here is pretty straight up and follows the article I found (shown below), but I get WebDriverException: Cannot click on option element.
Any suggestions to get a logic that works?
Here is the logic:
WebElement we;
String searchText;
WebDriver driver;
Select select;
WebElement listbox_element;
listbox_element = driver.findElement(By.cssSelector("span[aria-owns='ddlRegion_listbox']"));
listbox_element.click();
driver = new FirefoxDriver();
driver.get("http://preview.harriscountyfws.org/");
searchText="ALL";
we = driver.findElement(By.id("ddlRegion"));
select = new Select(we);
select.selectByVisibleText(searchText);
REF: http://www.techbeamers.com/dropdown-and-multiple-select-in-webdriver