+1 vote
704 views
in Software Testing by Expert (6.3k 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!
by Expert (6.3k points)
thanks it works :)

Not a Member yet?

Ask to Folks Login

My Account

Your feedback is highly appreciated