+1 vote
1.1k views
in Software Testing by Expert (6.4k points)

i have a web application ,their some dropdowns are their and want to automate them.

I am trying 

driver.findElement("By.id("ID")").click();

driver.findElement("By.id("ID")").sendKey("India");

But not working.

closed

1 Answer

+2 votes
by Expert (4.6k points)
selected by
 
Best answer

you should use select class like this :

      Select select = new Select(driver.findElement("By.id("ID")"));
       select.selectByValue("india");
Enjoy!
0
by Expert (6.4k points)
thanks it works :)

Not a Member yet?

Ask to Folks Login

My Account

Your feedback is highly appreciated