public class Select extends Object
Constructor and Description |
---|
Select(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<WebElement> |
getAllSelectedOptions() |
WebElement |
getFirstSelectedOption() |
List<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(WebElement element)
element
- SELECT element to wrapUnexpectedTagNameException
- when element is not a SELECTpublic boolean isMultiple()
public List<WebElement> getOptions()
public List<WebElement> getAllSelectedOptions()
public WebElement getFirstSelectedOption()
public void selectByVisibleText(String text)
text
- The visible text to match againstpublic void selectByIndex(int index)
index
- The option at this index will be selectedpublic void selectByValue(String value)
value
- The value to match againstpublic void deselectAll()
UnsupportedOperationException
- If the SELECT does not support multiple selectionspublic void deselectByValue(String value)
value
- The value to match againstpublic void deselectByIndex(int index)
index
- The option at this index will be deselectedpublic void deselectByVisibleText(String text)
text
- The visible text to match againstCopyright © 2013. All Rights Reserved.