After I get the class,I tried to dig into the orignal code,the class is really powerful,it help us do a lot of things.
first,select class is used to :
Models a SELECT tag, providing helper methods to select and deselect options.
the tag SELECT is really common in our web testing,mostly,when we do not know the class,normally we will use xpath or cssselector to locate the select
but what the class supplies are:
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.
|
没有评论:
发表评论