How can I select an item from a drop-down list like typesoffoodeatinganimals (eg carnivores, herbivorous) using Selenium WebDriver
Below is my code:
WebElement select = driver.findElement(By.id("typesoffoodeatinganimals "));
List<WebElement> options = select.findElements(By.tagName("Carnivores "));
for (WebElement option : options) {
if("Germany".equals(option.getText()))
option.click();
}
But it is not working