Select Classimport org.openqa.selenium.support.ui.Select;WebElement dropdownElement = driver.findElement(By.id("country-dropdown"));
Select countrySelect = new Select(dropdownElement);
// Selection options:
countrySelect.selectByVisibleText("United States");
countrySelect.selectByValue("US");
countrySelect.selectByIndex(1);
// Verifying selected option:
String chosen = countrySelect.getFirstSelectedOption().getText();