public class Select extends Object
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(String value)
Deselect all options that have a value matching the argument.
|
void |
deselectByVisibleText(String text)
Deselect all options that display text matching the argument.
|
protected String |
escapeQuotes(String toEscape) |
List<org.openqa.selenium.WebElement> |
getAllSelectedOptions() |
org.openqa.selenium.WebElement |
getFirstSelectedOption() |
List<org.openqa.selenium.WebElement> |
getOptions() |
boolean |
isMultiple() |
void |
selectByIndex(int index)
Select the option at the given index.
|
void |
selectByValue(String value)
Select all options that have a value matching the argument.
|
void |
selectByVisibleText(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 boolean isMultiple()
public List<org.openqa.selenium.WebElement> getOptions()
public List<org.openqa.selenium.WebElement> getAllSelectedOptions()
public org.openqa.selenium.WebElement getFirstSelectedOption()
org.openqa.selenium.NoSuchElementException
- If no option is selectedpublic void selectByVisibleText(String text)
text
- The visible text to match againstorg.openqa.selenium.NoSuchElementException
- If no matching option elements are foundpublic void selectByIndex(int index)
index
- The option at this index will be selectedorg.openqa.selenium.NoSuchElementException
- If no matching option elements are foundpublic void selectByValue(String value)
value
- The value to match againstorg.openqa.selenium.NoSuchElementException
- If no matching option elements are foundpublic void deselectAll()
UnsupportedOperationException
- If the SELECT does not support multiple selectionspublic void deselectByValue(String value)
value
- The value to match againstorg.openqa.selenium.NoSuchElementException
- If no matching option elements are foundpublic void deselectByIndex(int index)
index
- The option at this index will be deselectedorg.openqa.selenium.NoSuchElementException
- If no matching option elements are foundpublic void deselectByVisibleText(String text)
text
- The visible text to match againstorg.openqa.selenium.NoSuchElementException
- If no matching option elements are foundCopyright © 2015. All rights reserved.