selenium-webdriverSelect Class


Syntax

  • Java
  • deselectAll()
  • deselectByIndex(int index)
  • deselectByValue(java.lang.String value)
  • deselectByVisibleText(java.lang.String text)
  • getAllSelectedOptions()
  • getFirstSelectedOption()
  • getOptions()
  • isMultiple()
  • selectByIndex(int index)
  • selectByValue(java.lang.String value)
  • selectByVisibleText(java.lang.String text)

Parameters

ParametersDetails
indexThe option at this index will be selected
valueThe value to match against
textThe visible text to match against

Remarks

Select class of Selenium WebDriver provides useful methods for interacting with select options. User can perform operations on a select dropdown and also de-select operation using the below methods.

In C# the Select class is actually SelectElement