public function FormManipulationTrait::isChecked in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/jcalderonzumba/mink-phantomjs-driver/src/FormManipulationTrait.php \Zumba\Mink\Driver\FormManipulationTrait::isChecked()
Checks if the radio or checkbox is checked
Parameters
string $xpath:
Return value
bool
Throws
File
- vendor/
jcalderonzumba/ mink-phantomjs-driver/ src/ FormManipulationTrait.php, line 140
Class
- FormManipulationTrait
- Trait FormManipulationTrait @package Zumba\Mink\Driver
Namespace
Zumba\Mink\DriverCode
public function isChecked($xpath) {
$this
->findElement($xpath, 1);
$javascript = $this
->javascriptTemplateRender("is_checked.js.twig", array(
"xpath" => $xpath,
));
$checked = $this->browser
->evaluate($javascript);
if ($checked === null) {
throw new DriverException("Can not check when the element is not checkbox or radio");
}
return $checked;
}