Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are the advantages of selenium grid?

1073


What is Selenese?

1051


What are heightened privileges browsers?

1145


Write the code for reading and writing to excel through selenium?

981


How to insert a start point in selenium ide?

991


What is robot api?

1040


How to print Duplicate values in Drop Down List

955


How to check whether a text is underlined or not?

1002


What is fluent wait in selenium webdriver?

1056


What is testng assert and list out some common assertions supported by testng?

957


How to achieve database testing in selenium?

1044


How you can insert a break point in selenium ide?

946


How do you handle alert popup?

1004


Explain the difference between close and quit command?

1088


Can I navigate back and forth in a browser in selenium webdriver?

1051