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
How you build object repository in your project?
What are the important features of selenium ide?
Explain what does @test(invocationcount=?) And @test(threadpoolsize=?) Indicate.
Explain what is the difference between borland silk and selenium?
How to pause a test execution for 5 seconds at a specific point?
I am not able to use "style" attribute to locate element with ie browser?
Tell me how to verify tooltip text using selenium?
What is the selenese command to show the value of a variable in the log file?
What is the use of deselect all () method?
How can we clear a text written in a textbox?
What are the different types of frameworks?
How do you upload a file using selenium webdriver?
How many test cases you have automated per day?
What are the open-source frameworks supported by selenium webdriver?
Can we use selenium grid for performance testing?