How can I select an item from the drop-down list like Blood Group (A+, AB, O etc..) using Selenium WebDriver and Java.
Below is my code:
WebElement dropdown = driver.findElement(By.id("blood-group"));
List<WebElement> options = dropdown.findElements(By.tagName("AB"));
for (WebElement option : options) {
if("AB".equals(option.getText()))
option.click();
}
This is not working for me