\WebDriverSelect

Models a SELECT tag, providing helper methods to select and deselect options.

Summary

Methods
Properties
Constants
__construct()
isMultiple()
getOptions()
getAllSelectedOptions()
getFirstSelectedOption()
deselectAll()
selectByIndex()
selectByValue()
selectByVisibleText()
deselectByIndex()
deselectByValue()
deselectByVisibleText()
No public properties found
No constants found
escapeQuotes()
No protected properties found
N/A
No private methods found
$element
$isMulti
N/A

Properties

$element

$element : 

Type

$isMulti

$isMulti : 

Type

Methods

__construct()

__construct(\WebDriverElement  $element) 

Parameters

\WebDriverElement $element

isMultiple()

isMultiple() : boolean

Returns

boolean —

Whether this select element support selecting multiple

         options. This is done by checking the value of the 'multiple'
         attribute.

getOptions()

getOptions() : array

Returns

array —

All options belonging to this select tag.

getAllSelectedOptions()

getAllSelectedOptions() : array

Returns

array —

All selected options belonging to this select tag.

getFirstSelectedOption()

getFirstSelectedOption() : \WebDriverElement

Returns

\WebDriverElement —

The first selected option in this select tag (or

                     the currently selected option in a normal select)

deselectAll()

deselectAll() : void

Deselect all options in multiple select tag.

selectByIndex()

selectByIndex(integer  $index) : void

Select the option at the given index.

Parameters

integer $index

The index of the option. (0-based)

selectByValue()

selectByValue(string  $value) : void

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.

selectByVisibleText()

selectByVisibleText(string  $text) : void

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.

deselectByIndex()

deselectByIndex(integer  $index) : void

Deselect the option at the given index.

Parameters

integer $index

The index of the option. (0-based)

deselectByValue()

deselectByValue(string  $value) : void

Deselect 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.

deselectByVisibleText()

deselectByVisibleText(string  $text) : void

Deselect 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.

escapeQuotes()

escapeQuotes(string  $to_escape) : string

Convert strings with both quotes and ticks into: foo'"bar -> concat("foo'", '"', "bar")

Parameters

string $to_escape

The string to be converted.

Returns

string —

The escaped string.