Skip to main content

Posts

Showing posts from May, 2014

Select a value from drop down

Following are the few methods to select a value in drop down. 1 ) new Select(driver.findElement(By.id("ele_ID"))).selectByVisibleText("xxxxx"); 2) WebElement select = driver.findElement(By.id("ELE_ID")); List options = select.findElements(By.tagName("option")); for (WebElement option : options) { if("expected_string".equalsIgnoreCase(option.getText())) option.click(); }