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
Which of the selector ID, name, XPath or CSS should I use?
What is object repository? How can we create object repository in selenium?
Mention what is the difference between selenium and sikuli?
How to scroll down to a particular element?
What is the selenium's recording language?
What is the difference between selenium ide, selenium rc, and webdriver?
What are some advantages of selenium?
Explain how you can find broken images in a page using selenium web driver?
What are the advantages of rc?
How do perform drag and drop using webdriver?
What are some advantages of selenium grid?
How can you handle network latency using selenium?
Write a code snippet to perform mouse hover in webdriver.
How to pause a test execution for 5 seconds at a specific point?
How do you read data from excel?