Friday, June 10, 2011

How to print the values from the drop down



List<WebElement> we = driver.findElements(By.xpath("//select[@name='lr']//option"));       

System.out.println("*****  " +we.size() );
              
 for (int i=1;i<we.size();i++){
                    System.out.println("the values are : " + we.get(i).getText());
                }

}

No comments:

Post a Comment