public function FormManipulationTrait::submitForm 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::submitForm()
Submits a form given an xpath selector
Parameters
string $xpath:
Throws
File
- vendor/
jcalderonzumba/ mink-phantomjs-driver/ src/ FormManipulationTrait.php, line 48
Class
- FormManipulationTrait
- Trait FormManipulationTrait @package Zumba\Mink\Driver
Namespace
Zumba\Mink\DriverCode
public function submitForm($xpath) {
$element = $this
->findElement($xpath, 1);
$tagName = $this->browser
->tagName($element["page_id"], $element["ids"][0]);
if (strcmp(strtolower($tagName), "form") !== 0) {
throw new DriverException("Can not submit something that is not a form");
}
$this->browser
->trigger($element["page_id"], $element["ids"][0], "submit");
}