How do you get all the values from Drop Down list?

Answer Posted / p sureshchowdary

Select dropdown=new Select(d.findElement(By.id("month")));
List<WebElement> list=dropdown.getOptions();
for(WebElement we:list) {
System.out.println(we.getText());
}

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What programming languages can you use in selenium rc?

519


How you can insert a start point in selenium ide?

483


What are the locators available in selenium?

567


Mention what are the challenges in handling ajax call in selenium webdriver?

523


How do you capture an element loading after the page load?

484






What is a keyword driven framework?

547


Which of the selector ID, name, XPath or CSS should I use?

515


Tell me how can we launch different browsers in selenium webdriver?

496


What are the different components of selenium?

552


What is difference between @factory and @dataprovider annotation?

545


How you can switch between frames?

534


What is selenium 3.0?

501


How many exemptions do you know in selenium webdriver?

503


Why to choose python over java in selenium?

527


How to pass parameters using testng.xml?

495