Package org.openqa.selenium.support.ui
Interface ISelect
- All Known Implementing Classes:
Select
public interface ISelect
Created by evgeniyat on 13.05.16
ISelect interface makes a protocol for all kind of select elements (standard html and custom model)
-
Method Summary
Modifier and TypeMethodDescriptionvoidClear all selected entries.voidvoiddeselectByIndex(int index) Deselect the option at the given index.voiddeselectByValue(String value) Deselect all options that have a value matching the argument.voiddeselectByVisibleText(String text) Deselect all options that display text matching the argument.List<org.openqa.selenium.WebElement>org.openqa.selenium.WebElementList<org.openqa.selenium.WebElement>booleanvoidSelect all options that display text matching or containing the argument.voidselectByIndex(int index) Select the option at the given index.voidselectByValue(String value) Select all options that have a value matching the argument.voidselectByVisibleText(String text) Select all options that display text matching the argument.
-
Method Details
-
isMultiple
boolean isMultiple()- Returns:
- Whether this select element supports selecting multiple options at the same time? This is done by checking the value of the "multiple" attribute.
-
getOptions
List<org.openqa.selenium.WebElement> getOptions()- Returns:
- All options belonging to this select tag
-
getAllSelectedOptions
List<org.openqa.selenium.WebElement> getAllSelectedOptions()- Returns:
- All selected options belonging to this select tag
-
getFirstSelectedOption
org.openqa.selenium.WebElement getFirstSelectedOption()- Returns:
- The first selected option in this select tag (or the currently selected option in a normal select)
-
selectByVisibleText
Select all options that display text matching the argument. That is, when given "Bar" this would select an option like:<option value="foo">Bar</option>
- Parameters:
text- The visible text to match against
-
selectByContainsVisibleText
Select all options that display text matching or containing the argument. That is, when given "Bar" this would select an option like:<option value="foo">Bar</option>
Additionally, if no exact match is found, this will attempt to select options that contain the argument as a substring. For example, when given "1년", this would select an option like:
<option value="bar">1년납</option>
- Parameters:
text- The visible text to match or partially match against
-
selectByIndex
void selectByIndex(int index) Select the option at the given index. This is done by examining the "index" attribute of an element, and not merely by counting.- Parameters:
index- The option at this index will be selected
-
selectByValue
Select all options that have a value matching the argument. That is, when given "foo" this would select an option like:<option value="foo">Bar</option>
- Parameters:
value- The value to match against
-
deselectAll
void deselectAll()Clear all selected entries. This is only valid when the SELECT supports multiple selections. -
deselectByValue
Deselect all options that have a value matching the argument. That is, when given "foo" this would deselect an option like:<option value="foo">Bar</option>
- Parameters:
value- The value to match against
-
deselectByIndex
void deselectByIndex(int index) Deselect the option at the given index. This is done by examining the "index" attribute of an element, and not merely by counting.- Parameters:
index- The option at this index will be deselected
-
deselectByVisibleText
Deselect all options that display text matching the argument. That is, when given "Bar" this would deselect an option like:<option value="foo">Bar</option>
- Parameters:
text- The visible text to match against
-
deSelectByContainsVisibleText
-