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 are the advantages of selenium grid?
What is Selenese?
What are heightened privileges browsers?
Write the code for reading and writing to excel through selenium?
How to insert a start point in selenium ide?
What is robot api?
How to print Duplicate values in Drop Down List
How to check whether a text is underlined or not?
What is fluent wait in selenium webdriver?
What is testng assert and list out some common assertions supported by testng?
How to achieve database testing in selenium?
How you can insert a break point in selenium ide?
How do you handle alert popup?
Explain the difference between close and quit command?
Can I navigate back and forth in a browser in selenium webdriver?