-2

Following is my code

Select drpCounty = new Select(driver.findElement(By.name("county")));
drpCounty.selectByVisibleText("Bedfordshire");
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

1 Answers1

1

Check visibility of elements:

new WebDriverWait(driver, 15).until(ExpectedConditions.visibilityOfElementLocated(By.name("county")));
Select drpCounty = new Select(driver.findElement(By.name("county")));
drpCounty.selectByVisibleText("Bedfordshire");
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
SeleniumUser
  • 4,065
  • 2
  • 7
  • 30