How do you get all the values from Drop Down list?

Answer Posted / raam

----------------------------------------------
Select cel=new Select(driver.findElement(By.id("name"))

cel.selectByVisibleText("state")
---------------------------------------
instead of selectByVisibleText can use-

selectByindex()
getoptions()---used to store all options inside drop down

Is This Answer Correct ?    8 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What programming language is best for writing selenium tests?

514


what are the testing frameworks used in selenium?

605


where do u maintain all your test cases in manual not in selenium

946


What are the different components in selenium?

558


Is selenium capable of handling windows pop-ups?

549






what are challenges you faced in your last project?

1106


What are the technical limitations while using selenium rc?

561


How to find the xpath of web table elements.in chrome or internet explorer.or without using fire bug.?

1140


What is the use of driver.get("url") and driver.navigate().to("url") command? Is there any difference between the two?

608


What are the different types of wait statements in selenium webdriver? Or how do you achieve synchronization in webdriver?

555


Tell me how to verify tooltip text using selenium?

531


How can we find the value of different attributes like name, class, value of an element?

588


Define selenium 2.x?

728


What are the important selenium ide commands or selenese commands?

569


What is selenium 2.0?

761