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 are the different mouse actions that can be performed?

507


What is the difference between borland silk and selenium?

515


What is the difference between single and double slash in xpath?

582


What selenese command and argument can be used to transfer the value of a javascript variable into a side variable?

4257


What do you know about Selenese?

551






Explain me how to handle alerts in selenium webdriver?

490


Which files can be used as data source for different frameworks?

1080


Explain how you can capture server side log selenium server?

515


In selenium what are breakpoints and startpoints?

488


How to launch a browser using selenium webdriver?

449


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

432


Mention what is desired capability? How is it useful in terms of selenium?

490


what are the four parameter you have to pass in selenium?

1169


How do you handle alert popup?

534


How is selenium different from qtp?

469