AbstractWebDriverCheckboxOrRadio
in package
implements
WebDriverSelectInterface
Provides helper methods for checkboxes and radio buttons.
Table of Contents
Interfaces
- WebDriverSelectInterface
- Models an element of select type, providing helper methods to select and deselect options.
Properties
- $element : WebDriverElement
- $name : string
- $type : string
Methods
- __construct() : mixed
- getAllSelectedOptions() : array<string|int, WebDriverElement>
- getFirstSelectedOption() : WebDriverElement
- getOptions() : array<string|int, WebDriverElement>
- selectByIndex() : mixed
- Select the option at the given index.
- selectByValue() : mixed
- Select all options that have value attribute matching the argument. That is, when given "foo" this would select an option like:
- selectByVisiblePartialText() : mixed
- Select all options that display text partially matching the argument. That is, when given "Bar" this would select an option like:
- selectByVisibleText() : mixed
- Select all options that display text matching the argument. That is, when given "Bar" this would select an option like:
- byIndex() : mixed
- Selects or deselects a checkbox or a radio button by its index.
- byValue() : mixed
- Selects or deselects a checkbox or a radio button by its value.
- byVisibleText() : mixed
- Selects or deselects a checkbox or a radio button by its visible text.
- deselectOption() : mixed
- Deselects a checkbox or a radio button.
- getRelatedElements() : array<string|int, WebDriverElement>
- Gets checkboxes or radio buttons with the same name.
- selectOption() : mixed
- Selects a checkbox or a radio button.
Properties
$element
protected
WebDriverElement
$element
$name
protected
string
$name
$type
protected
string
$type
Methods
__construct()
public
__construct(WebDriverElement $element) : mixed
Parameters
- $element : WebDriverElement
getAllSelectedOptions()
public
getAllSelectedOptions() : array<string|int, WebDriverElement>
Return values
array<string|int, WebDriverElement> —All selected options belonging to this select tag.
getFirstSelectedOption()
public
getFirstSelectedOption() : WebDriverElement
Return values
WebDriverElement —The first selected option in this select tag (or the currently selected option in a normal select)
getOptions()
public
getOptions() : array<string|int, WebDriverElement>
Return values
array<string|int, WebDriverElement> —All options belonging to this select tag.
selectByIndex()
Select the option at the given index.
public
selectByIndex(mixed $index) : mixed
Parameters
- $index : mixed
-
The index of the option. (0-based)
selectByValue()
Select all options that have value attribute matching the argument. That is, when given "foo" this would select an option like:
public
selectByValue(mixed $value) : mixed
<option value="foo">Bar</option>
Parameters
- $value : mixed
-
The value to match against.
selectByVisiblePartialText()
Select all options that display text partially matching the argument. That is, when given "Bar" this would select an option like:
public
selectByVisiblePartialText(mixed $text) : mixed
<option value="bar">Foo Bar Baz</option>
Parameters
- $text : mixed
-
The visible text to match against.
selectByVisibleText()
Select all options that display text matching the argument. That is, when given "Bar" this would select an option like:
public
selectByVisibleText(mixed $text) : mixed
<option value="foo">Bar</option>
Parameters
- $text : mixed
-
The visible text to match against.
byIndex()
Selects or deselects a checkbox or a radio button by its index.
protected
byIndex(int $index[, bool $select = true ]) : mixed
Parameters
- $index : int
- $select : bool = true
Tags
byValue()
Selects or deselects a checkbox or a radio button by its value.
protected
byValue(string $value[, bool $select = true ]) : mixed
Parameters
- $value : string
- $select : bool = true
Tags
byVisibleText()
Selects or deselects a checkbox or a radio button by its visible text.
protected
byVisibleText(string $text[, bool $partial = false ][, bool $select = true ]) : mixed
Parameters
- $text : string
- $partial : bool = false
- $select : bool = true
deselectOption()
Deselects a checkbox or a radio button.
protected
deselectOption(WebDriverElement $element) : mixed
Parameters
- $element : WebDriverElement
getRelatedElements()
Gets checkboxes or radio buttons with the same name.
protected
getRelatedElements([string|null $value = null ]) : array<string|int, WebDriverElement>
Parameters
- $value : string|null = null
Return values
array<string|int, WebDriverElement>selectOption()
Selects a checkbox or a radio button.
protected
selectOption(WebDriverElement $element) : mixed
Parameters
- $element : WebDriverElement