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

How to get the title of the page?

940


Explain what does @test(invocationcount=?) And @test(threadpoolsize=?) Indicate.

4265


What does side stand for?

905


What are the important features of selenium ide?

1004


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

922


What are the challenges and limitations of selenium webdriver?

962


What api is required for database testing in selenium webdriver?

1046


What is webdriver wait in selenium webdriver?

1086


Write a code snippet to navigate back and forward in browser history?

1008


What could be the cause of the selenium webdriver test to fail?

863


How to scroll down a page using javascript in selenium?

926


List the different types of locaters in selenium.

921


What is the selenium's recording language?

1005


What is pom (page object model)?

921


What is the purpose of creating a reference variable- 'driver' of type webdriver instead of directly creating a firefoxdriver object or any other driver's reference in the statement webdriver driver = new firefoxdriver();?

967