Constructor and Description |
---|
Select(org.openqa.selenium.WebElement element)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
deselectAll()
Clear all selected entries.
|
void |
deselectByIndex(int index)
Deselect the option at the given index.
|
void |
deselectByValue(java.lang.String value)
Deselect all options that have a value matching the argument.
|
void |
deselectByVisibleText(java.lang.String text)
Deselect all options that display text matching the argument.
|
boolean |
equals(java.lang.Object o) |
java.util.List<org.openqa.selenium.WebElement> |
getAllSelectedOptions() |
org.openqa.selenium.WebElement |
getFirstSelectedOption() |
java.util.List<org.openqa.selenium.WebElement> |
getOptions() |
org.openqa.selenium.WebElement |
getWrappedElement() |
int |
hashCode() |
boolean |
isMultiple() |
void |
selectByIndex(int index)
Select the option at the given index.
|
void |
selectByValue(java.lang.String value)
Select all options that have a value matching the argument.
|
void |
selectByVisibleText(java.lang.String text)
Select all options that display text matching the argument.
|
public Select(org.openqa.selenium.WebElement element)
element
- SELECT element to wrapUnexpectedTagNameException
- when element is not a SELECTpublic org.openqa.selenium.WebElement getWrappedElement()
getWrappedElement
in interface org.openqa.selenium.WrapsElement
public boolean isMultiple()
isMultiple
in interface ISelect
public java.util.List<org.openqa.selenium.WebElement> getOptions()
getOptions
in interface ISelect
public java.util.List<org.openqa.selenium.WebElement> getAllSelectedOptions()
getAllSelectedOptions
in interface ISelect
public org.openqa.selenium.WebElement getFirstSelectedOption()
getFirstSelectedOption
in interface ISelect
org.openqa.selenium.NoSuchElementException
- If no option is selectedpublic void selectByVisibleText(java.lang.String text)
selectByVisibleText
in interface ISelect
text
- The visible text to match againstorg.openqa.selenium.NoSuchElementException
- If no matching option elements are foundpublic void selectByIndex(int index)
selectByIndex
in interface ISelect
index
- The option at this index will be selectedorg.openqa.selenium.NoSuchElementException
- If no matching option elements are foundpublic void selectByValue(java.lang.String value)
selectByValue
in interface ISelect
value
- The value to match againstorg.openqa.selenium.NoSuchElementException
- If no matching option elements are foundpublic void deselectAll()
deselectAll
in interface ISelect
java.lang.UnsupportedOperationException
- If the SELECT does not support multiple selectionspublic void deselectByValue(java.lang.String value)
deselectByValue
in interface ISelect
value
- The value to match againstorg.openqa.selenium.NoSuchElementException
- If no matching option elements are foundjava.lang.UnsupportedOperationException
- If the SELECT does not support multiple selectionspublic void deselectByIndex(int index)
deselectByIndex
in interface ISelect
index
- The option at this index will be deselectedorg.openqa.selenium.NoSuchElementException
- If no matching option elements are foundjava.lang.UnsupportedOperationException
- If the SELECT does not support multiple selectionspublic void deselectByVisibleText(java.lang.String text)
deselectByVisibleText
in interface ISelect
text
- The visible text to match againstorg.openqa.selenium.NoSuchElementException
- If no matching option elements are foundjava.lang.UnsupportedOperationException
- If the SELECT does not support multiple selectionspublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object