RE: How to test dropdown using selenium webdriver Java while no select tag in html code

qaselenium2016 Default Asked on January 23, 2016 in Selenium WebDriver.
Add Comment
2 Answers

This is the sample code to get options in ‘Month’ dropdown list on Facebook login page –

List<WebElement> options = driver.findElement(By.id(“month”)).findElements(By.tagName(“option”));
for (WebElement optiohhn : options)
{
System.out.println(optiohhn.getText());
//option.click();
}

Default Answered on January 26, 2016.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.