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

Can you run the tests registered with Selenium IDE in other browsers?

529


Name an api used for reading and writing data to excel files?

476


Tell us what kinds of test types are supported by selenium?

473


What are the advantages of pom?

554


What are the test types supported by selenium?

511






What are the programming languages supported by selenium webdiver?

472


What is the framework?

484


What is selenium 1.0?

478


What are various ways of locating an element in selenium?

466


What are the uses of findelement() and findelements()?

459


From your test script how you can create html test report?

473


What is the automation test?

544


How to handle ajax calls in selenium webdriver?

515


What is a data driven framework?

519


sorting java array

1245