class WebDriverCheckboxes extends AbstractWebDriverCheckboxOrRadio (View source)

Provides helper methods for checkboxes.

Properties

protected WebDriverElement $element from  AbstractWebDriverCheckboxOrRadio
protected string $type from  AbstractWebDriverCheckboxOrRadio
protected string $name from  AbstractWebDriverCheckboxOrRadio

Methods

__construct(WebDriverElement $element)

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:

byValue(string $value, bool $select = true)

Selects or deselects a checkbox or a radio button by its value.

byIndex(int $index, bool $select = true)

Selects or deselects a checkbox or a radio button by its index.

byVisibleText(string $text, bool $partial = false, bool $select = true)

Selects or deselects a checkbox or a radio button by its visible text.

getRelatedElements(string|null $value = null)

Gets checkboxes or radio buttons with the same name.

selectOption(WebDriverElement $element)

Selects a checkbox or a radio button.

deselectOption(WebDriverElement $element)

Deselects a checkbox or a radio button.

bool
isMultiple()

No description

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

__construct(WebDriverElement $element)

No description

Parameters

WebDriverElement $element

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:

<option value="foo">Bar</option>

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:

<option value="foo">Bar</option>

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:

<option value="bar">Foo Bar Baz</option>

Parameters

string $text

The visible text to match against.

Exceptions

NoSuchElementException

protected byValue(string $value, bool $select = true)

Selects or deselects a checkbox or a radio button by its value.

Parameters

string $value
bool $select

Exceptions

NoSuchElementException

protected byIndex(int $index, bool $select = true)

Selects or deselects a checkbox or a radio button by its index.

Parameters

int $index
bool $select

Exceptions

NoSuchElementException

protected byVisibleText(string $text, bool $partial = false, bool $select = true)

Selects or deselects a checkbox or a radio button by its visible text.

Parameters

string $text
bool $partial
bool $select

protected WebDriverElement[] getRelatedElements(string|null $value = null)

Gets checkboxes or radio buttons with the same name.

Parameters

string|null $value

Return Value

WebDriverElement[]

protected selectOption(WebDriverElement $element)

Selects a checkbox or a radio button.

Parameters

WebDriverElement $element

protected deselectOption(WebDriverElement $element)

Deselects a checkbox or a radio button.

Parameters

WebDriverElement $element

bool isMultiple()

No description

Return Value

bool

Whether this select element support selecting multiple options.

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:

<option value="foo">Bar</option>

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:

<option value="foo">Bar</option>

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:

<option value="foo">Foo Bar Baz</option>

Parameters

string $text

The visible text to match against.

Exceptions

UnsupportedOperationException