Tuesday, 23 April 2013

How to manage drop down with selenium webdriver



 List dd = driver.findElement(By.name("_sacat")).findElements(By.tagName("option"));
   for (WebElement option : dd) {
    System.out.println(option.getText());
    if ("Consumer Electronics".equalsIgnoreCase(option.getText())){
     option.click();
     break;
    }

No comments:

Post a Comment