Skip to main content
2 of 3
improved formatting of embedded code: language syntax hint

Order in which options are returned by getOptions() in dropdown box(Select Class) in Selenium WebDriver?

When we get options of a dropdown in Selenium Webdriver the following way

 Select dropdown = new Select(driver.findElement(By.id(dropDownId)));
 List<WebElement> options = dropdown.getOptions();

What is order of elements in the list returned by getOptions method?
I want to have the elements in the order they appear in the dropdown. Does it happen that way?

Neeraj Kumar
  • 143
  • 1
  • 2
  • 4