Select dropDown = new Select(driver.findElement(By...));
List<WebElement> options = dropDown.getOptions();
Or you can do it directly:
WebElement dropDown1 = driver.findElement(By...);
List<WebElement> options = dropDown.findElements(By.tagName("option"));
Then you can iterate through options to get value or text:
for (WebElement el : options) {
System.out.println(el.getValue());
}
On Fri, Aug 20, 2010 at 8:57 AM, Binken <binke...@gmail.com> wrote:
> How can I get Dropdown values using Selenium(Webdriver)
>
> --
> You received this message because you are subscribed to the Google Groups "Selenium Users" group.
> To post to this group, send email to seleniu...@googlegroups.com.
> To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
>
>