public function FormManipulationTrait::setValue in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/jcalderonzumba/mink-phantomjs-driver/src/FormManipulationTrait.php \Zumba\Mink\Driver\FormManipulationTrait::setValue()
Parameters
string $xpath:
string $value:
Throws
File
- vendor/
jcalderonzumba/ mink-phantomjs-driver/ src/ FormManipulationTrait.php, line 31
Class
- FormManipulationTrait
- Trait FormManipulationTrait @package Zumba\Mink\Driver
Namespace
Zumba\Mink\DriverCode
public function setValue($xpath, $value) {
$this
->findElement($xpath, 1);
//This stuff is BECAUSE the way the driver works for setting values when being checkboxes, radios, etc.
if (is_bool($value)) {
$value = $this
->boolToString($value);
}
$javascript = $this
->javascriptTemplateRender("set_value.js.twig", array(
"xpath" => $xpath,
"value" => json_encode($value),
));
$this->browser
->evaluate($javascript);
}