You are here

public function TraversableElement::selectFieldOption in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/behat/mink/src/Element/TraversableElement.php \Behat\Mink\Element\TraversableElement::selectFieldOption()

Selects option from select field with specified locator.

Parameters

string $locator input id, name or label:

string $value option value:

Boolean $multiple select multiple options:

Throws

ElementNotFoundException

See also

NodeElement::selectOption

File

vendor/behat/mink/src/Element/TraversableElement.php, line 254

Class

TraversableElement
Traversable element.

Namespace

Behat\Mink\Element

Code

public function selectFieldOption($locator, $value, $multiple = false) {
  $field = $this
    ->findField($locator);
  if (null === $field) {
    throw new ElementNotFoundException($this
      ->getDriver(), 'form field', 'id|name|label|value', $locator);
  }
  $field
    ->selectOption($value, $multiple);
}