function Selenium2Driver::selectOption
Overrides CoreDriver::selectOption
File
-
vendor/
lullabot/ mink-selenium2-driver/ src/ Selenium2Driver.php, line 826
Class
- Selenium2Driver
- Selenium2 driver.
Namespace
Behat\Mink\DriverCode
public function selectOption(string $xpath, string $value, bool $multiple = false) {
$element = $this->findElement($xpath);
$tagName = strtolower($element->name());
if ('input' === $tagName && 'radio' === strtolower($element->attribute('type') ?: '')) {
$this->selectRadioValue($element, $value);
return;
}
if ('select' === $tagName) {
$this->selectOptionOnElement($element, $value, $multiple);
return;
}
throw new DriverException(sprintf('Impossible to select an option on the element with XPath "%s" as it is not a select or radio input', $xpath));
}