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 happen if you mix both implicit wait and explicit wait in a selenium script?

453


how to handle staleelementreferenceexception?

497


Tell me why to choose python over java in selenium?

454


What are the different types of locators in Selenium?

518


When should I use selenium grid?

554






List some of the test types that are supported by selenium.

458


When should I use Selenium IDE?

530


What is parameterization in testng? How to pass parameters using testng.xml?

468


Mention in what ways you can customize testng report?

739


How selenium grid hub keeps in touch with rc slave machine?

473


What is the purpose of deselecting all() method?

494


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

456


How can we handle window ui elements and window pop ups using selenium?

436


What is the hybrid framework?

567


Which browsers can selenium ide be run in?

523