protected function findElement($xpath, $max = 1) {
    $elements = $this->browser->find("xpath", $xpath);
    if (!isset($elements["page_id"]) || !isset($elements["ids"]) || count($elements["ids"]) !== $max) {
      throw new DriverException("Failed to get elements with given $xpath");
    }
    return $elements;
  }
protected function findElement($xpath, $max = 1) {
    $elements = $this->browser->find("xpath", $xpath);
    if (!isset($elements["page_id"]) || !isset($elements["ids"]) || count($elements["ids"]) !== $max) {
      throw new DriverException("Failed to get elements with given $xpath");
    }
    return $elements;
  }
protected function findElement ( $ xpath , $ max = 1 ) { $ elements = $ this -> browser -> find ( "xpath" , $ xpath ) ; if ( ! isset ( $ elements [ "page_id" ] ) || ! isset ( $ elements [ "ids" ] ) || count ( $ elements [ "ids" ] ) !== $ max ) { throw new DriverException ( "Failed to get elements with given $xpath" ) ; } return $ elements ; }
Helper to find a node element given an xpath
@param string $xpath
@param int    $max
@returns int
@throws DriverException
Helper to find a node element given an xpath