You are here

public function FormManipulationTrait::submitForm in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/jcalderonzumba/mink-phantomjs-driver/src/FormManipulationTrait.php \Zumba\Mink\Driver\FormManipulationTrait::submitForm()

Submits a form given an xpath selector

Parameters

string $xpath:

Throws

DriverException

File

vendor/jcalderonzumba/mink-phantomjs-driver/src/FormManipulationTrait.php, line 48

Class

FormManipulationTrait
Trait FormManipulationTrait @package Zumba\Mink\Driver

Namespace

Zumba\Mink\Driver

Code

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");
}