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

If the test case frame contains several test cases, how can one execute just the selected one of those test cases?

484


How to set test case priority in testng?

544


Explain the difference between confirming and verifying commands?

547


What is pom (page object model)? What are its advantages?

471


Explain me what could be the cause of selenium webdriver test to fail?

449






Tell us what are the two modes of views in selenium ide?

466


Explain why to choose python over java in selenium?

485


What is a fundamental difference between xpath and css selector?

500


What are the different exceptions you got when working with webdriver?

465


What happens if I run this command. Driver.get(“www.softwaretestingmaterial.com”) ;

1322


What are the operating systems supported by selenium webdriver?

443


What is the significance of testng.xml?

3245


Explain in selenium ide how can you debug the tests?

471


What is object repository? How can we create an object repository in selenium?

512


How to execute javascript in selenium?

542