Dropdowns selection in Webdriver | Selenium Forum
M
Posted on 04/10/2015
Hey Ashish,

what are the different keywords used to select drop downs, can you give me a oneliner command on how to write code to select country US from country dropdown and also which video i can refer the same,
i figured out one, is there any other method apart from this
WebElement droplist=driver.findElement(By.xpath("//*[@id='account']/div[1]/div[5]/div[3]/div/select"));
droplist.sendKeys("US);

thanks for your assistance
regards
subash

M
Replied on 05/10/2015

watch module 13 for drop down.

"WebElement droplist=driver.findElement(By.xpath("//*[@id='account']/div[1]/div[5]/div[3]/div/select"));
droplist.sendKeys("US);"


use this
driver.findElement(By.xpath("//*[@id='account']/div[1]/div[5]/div[3]/div/select")).sendKeys("US");


M
Replied on 05/10/2015

You can also use select class in webdriver api


M
Replied on 05/10/2015

Thanks for your comments


M
Replied on 06/10/2015

http://www.softwaretestinghelp.com/selenium-select-class-selenium-tutorial-13/