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
If the test case frame contains several test cases, how can one execute just the selected one of those test cases?
Can you write the code to double click an element in selenium?
What are the different types of locators in Selenium?
Explain what is group test in testng?
Explain what is the main difference between web-driver and rc?
Explain me how many types of webdriver apis are available in selenium?
What is automation testing?
How would one access the value of a side variable named name from within a javascript snippet used as the argument to a selenese command?
List some advantages of test automation?
How do you send enter/tab keys in webdriver?
Mention what is desired capability? How is it useful in terms of selenium?
Which is the command used for displaying the values of a variable into the output console or log?
How can we create a data-driven framework using testng?
List some scenarios which we cannot automate using selenium webdriver?
How to check the checkbox or radio button is selected?