List<WebElement> statusvalues = driver.findElements(By.id("ddlStatus"));
for (WebElement option : statusvalues)
{
System.out.println(option.getText());
}
This is the script I have used to write.
System not providing the error but I didn't get the result. There are five drop down values I need to write in the output. The HTML
code is given below.
<select id="ddlStatus" name="Status" class="full-width" data-role="dropdownlist" style="display: none;">
<option value="" selected="selected"> -- Select -- </option>
<option value="11">Arts</option>
<option value="13">Science</option>
<option value="14">Engineering</option>
<option value="64">Law</option>
<option value="85">Teaching</option>
<option value="87">Journalist</option>
</select>
Just exploring the selenium webdriver and how to write the drop down values in the output.