|
||||||||||
| 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(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. |
protected java.lang.String |
escapeQuotes(java.lang.String toEscape)
|
java.util.List<WebElement> |
getAllSelectedOptions()
|
WebElement |
getFirstSelectedOption()
|
java.util.List<WebElement> |
getOptions()
|
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. |
| 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 SELECT| Method Detail |
|---|
public boolean isMultiple()
public java.util.List<WebElement> getOptions()
public java.util.List<WebElement> getAllSelectedOptions()
public WebElement getFirstSelectedOption()
public void selectByVisibleText(java.lang.String text)
text - The visible text to match againstpublic void selectByIndex(int index)
index - The option at this index will be selectedpublic void selectByValue(java.lang.String value)
value - The value to match againstpublic void deselectAll()
java.lang.UnsupportedOperationException - If the SELECT does not support multiple selectionspublic void deselectByValue(java.lang.String value)
value - The value to match againstpublic void deselectByIndex(int index)
index - The option at this index will be deselectedpublic void deselectByVisibleText(java.lang.String text)
text - The visible text to match againstprotected java.lang.String escapeQuotes(java.lang.String toEscape)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||