-2

Following is my code

Select drpCounty = new Select(driver.findElement(By.name("county")));
drpCounty.selectByVisibleText("Bedfordshire");
undetected Selenium
  • 151,581
  • 34
  • 225
  • 281

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
  • 151,581
  • 34
  • 225
  • 281
SeleniumUser
  • 3,833
  • 2
  • 6
  • 23