10. Automating Dropdowns with Select Class

The Select Class

Select select = new Select(driver.findElement(By.id("country")));
select.selectByVisibleText("India");
select.selectByValue("IN");
select.selectByIndex(1);

Task

  • Create a `Select` instance for the dropdown element and select `"India"` by visible text.
💡Common doubts
Did you like the problem?
Lesson 10 of 18
Java
Loading code editor…
Next