| 构造器和说明 |
|---|
Select(WebElement element)
Constructor.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
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()
isMultiple 在接口中 ISelectpublic List<WebElement> getOptions()
getOptions 在接口中 ISelectpublic List<WebElement> getAllSelectedOptions()
getAllSelectedOptions 在接口中 ISelectpublic WebElement getFirstSelectedOption()
getFirstSelectedOption 在接口中 ISelectNoSuchElementException - If no option is selectedpublic void selectByVisibleText(String text)
selectByVisibleText 在接口中 ISelecttext - The visible text to match againstNoSuchElementException - If no matching option elements are foundpublic void selectByIndex(int index)
selectByIndex 在接口中 ISelectindex - The option at this index will be selectedNoSuchElementException - If no matching option elements are foundpublic void selectByValue(String value)
selectByValue 在接口中 ISelectvalue - The value to match againstNoSuchElementException - If no matching option elements are foundpublic void deselectAll()
deselectAll 在接口中 ISelectUnsupportedOperationException - If the SELECT does not support multiple selectionspublic void deselectByValue(String value)
deselectByValue 在接口中 ISelectvalue - The value to match againstNoSuchElementException - If no matching option elements are foundUnsupportedOperationException - If the SELECT does not support multiple selectionspublic void deselectByIndex(int index)
deselectByIndex 在接口中 ISelectindex - The option at this index will be deselectedNoSuchElementException - If no matching option elements are foundUnsupportedOperationException - If the SELECT does not support multiple selectionspublic void deselectByVisibleText(String text)
deselectByVisibleText 在接口中 ISelecttext - The visible text to match againstNoSuchElementException - If no matching option elements are foundUnsupportedOperationException - If the SELECT does not support multiple selections