How do you get all the values from Drop Down list?
Answer Posted / rupesh
WebElement sel = myD.findElement(By.name("dropdown_name"));
List<WebElement> lists = sel.findElements(By.tagName("option"));
for(WebElement element: lists)
{
String var2 = tdElement.getText();
System.out.println(var2);
}
| Is This Answer Correct ? | 10 Yes | 0 No |
Post New Answer View All Answers
What is an XPath?
What are the testing kinds that can be supported by selenium?
Tell me do you know a way to refresh browser by using selenium?
How to get the number of frames on a page?
How to execute javascript in selenium?
What are the advantages of automation framework?
Are you familiar with selenium? If yes, what is it?
How is assert command different from verify command?
Give selenium ide tool disadvantage?
Write a code snippet to launch chrome browser in webdriver.
What is fluent wait in selenium?
How can we select elements by their attribute value using css selector?
What are the different types of drivers available in webdriver?
What is the difference between find elements () and find element ()?
when autoit is used?