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

Default Asked on January 23, 2016 in Selenium WebDriver.
Add Comment
  • 2 Answer(s)

    Please post the html code for that webelement so we can try

    Default Answered on January 26, 2016.
    Add Comment

    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.