|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openqa.selenium.support.ui.Select
public class Select
Models a SELECT tag, providing helper methods to select and deselect options.
Constructor Summary | |
---|---|
Select(WebElement element)
Constructor. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Select(WebElement element)
element
- SELECT element to wrap
UnexpectedTagNameException
- when element is not a SELECTMethod Detail |
---|
public 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 againstprotected String escapeQuotes(String toEscape)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |