interface WebDriverSelectInterface (View source)

Models an element of select type, providing helper methods to select and deselect options.

Methods

bool
isMultiple()

No description

getOptions()

No description

selectByIndex(int $index)

Select the option at the given index.

selectByValue(string $value)

Select all options that have value attribute matching the argument. That is, when given "foo" this would select an option like:

selectByVisibleText(string $text)

Select all options that display text matching the argument. That is, when given "Bar" this would select an option like:

selectByVisiblePartialText(string $text)

Select all options that display text partially matching the argument. That is, when given "Bar" this would select an option like:

deselectAll()

Deselect all options in multiple select tag.

deselectByIndex(int $index)

Deselect the option at the given index.

deselectByValue(string $value)

Deselect all options that have value attribute matching the argument. That is, when given "foo" this would deselect an option like:

deselectByVisibleText(string $text)

Deselect all options that display text matching the argument. That is, when given "Bar" this would deselect an option like:

deselectByVisiblePartialText(string $text)

Deselect all options that display text matching the argument. That is, when given "Bar" this would deselect an option like:

Details

bool isMultiple()

No description

Return Value

bool

Whether this select element support selecting multiple options.

WebDriverElement[] getOptions()

No description

Return Value

WebDriverElement[]

All options belonging to this select tag.

WebDriverElement[] getAllSelectedOptions()

No description

Return Value

WebDriverElement[]

All selected options belonging to this select tag.

WebDriverElement getFirstSelectedOption()

No description

Return Value

WebDriverElement

The first selected option in this select tag (or the currently selected option in a normal select)

Exceptions

NoSuchElementException

selectByIndex(int $index)

Select the option at the given index.

Parameters

int $index

The index of the option. (0-based)

Exceptions

NoSuchElementException

selectByValue(string $value)

Select all options that have value attribute matching the argument. That is, when given "foo" this would select an option like:

;

Parameters

string $value

The value to match against.

Exceptions

NoSuchElementException

selectByVisibleText(string $text)

Select all options that display text matching the argument. That is, when given "Bar" this would select an option like:

;

Parameters

string $text

The visible text to match against.

Exceptions

NoSuchElementException

selectByVisiblePartialText(string $text)

Select all options that display text partially matching the argument. That is, when given "Bar" this would select an option like:

;

Parameters

string $text

The visible text to match against.

Exceptions

NoSuchElementException

deselectAll()

Deselect all options in multiple select tag.

deselectByIndex(int $index)

Deselect the option at the given index.

Parameters

int $index

The index of the option. (0-based)

Exceptions

UnsupportedOperationException

deselectByValue(string $value)

Deselect all options that have value attribute matching the argument. That is, when given "foo" this would deselect an option like:

;

Parameters

string $value

The value to match against.

Exceptions

UnsupportedOperationException

deselectByVisibleText(string $text)

Deselect all options that display text matching the argument. That is, when given "Bar" this would deselect an option like:

;

Parameters

string $text

The visible text to match against.

Exceptions

UnsupportedOperationException

deselectByVisiblePartialText(string $text)

Deselect all options that display text matching the argument. That is, when given "Bar" this would deselect an option like:

;

Parameters

string $text

The visible text to match against.

Exceptions

UnsupportedOperationException