public function selectOption($xpath, $value, $multiple = false) {
    $element = $this->findElement($xpath, 1);
    $tagName = strtolower($this->browser->tagName($element["page_id"], $element["ids"][0]));
    $attributes = $this->browser->attributes($element["page_id"], $element["ids"][0]);

    if (!in_array($tagName, array("input", "select"))) {
      throw new DriverException(sprintf('Impossible to select an option on the element with XPath "%s" as it is not a select or radio input', $xpath));
    }

    if ($tagName === "input" && $attributes["type"] != "radio") {
      throw new DriverException(sprintf('Impossible to select an option on the element with XPath "%s" as it is not a select or radio input', $xpath));
    }

    return $this->browser->selectOption($element["page_id"], $element["ids"][0], $value, $multiple);
  }
public function selectOption($xpath, $value, $multiple = false) {
    $element = $this->findElement($xpath, 1);
    $tagName = strtolower($this->browser->tagName($element["page_id"], $element["ids"][0]));
    $attributes = $this->browser->attributes($element["page_id"], $element["ids"][0]);

    if (!in_array($tagName, array("input", "select"))) {
      throw new DriverException(sprintf('Impossible to select an option on the element with XPath "%s" as it is not a select or radio input', $xpath));
    }

    if ($tagName === "input" && $attributes["type"] != "radio") {
      throw new DriverException(sprintf('Impossible to select an option on the element with XPath "%s" as it is not a select or radio input', $xpath));
    }

    return $this->browser->selectOption($element["page_id"], $element["ids"][0], $value, $multiple);
  }
public function selectOption ( $ xpath , $ value , $ multiple = false ) { $ element = $ this -> findElement ( $ xpath , 1 ) ; $ tagName = strtolower ( $ this -> browser -> tagName ( $ element [ "page_id" ] , $ element [ "ids" ] [ 0 ] ) ) ; $ attributes = $ this -> browser -> attributes ( $ element [ "page_id" ] , $ element [ "ids" ] [ 0 ] ) ; if ( ! in_array ( $ tagName , array ( "input" , "select" ) ) ) { throw new DriverException ( sprintf ( 'Impossible to select an option on the element with XPath "%s" as it is not a select or radio input' , $ xpath ) ) ; } if ( $ tagName === "input" && $ attributes [ "type" ] != "radio" ) { throw new DriverException ( sprintf ( 'Impossible to select an option on the element with XPath "%s" as it is not a select or radio input' , $ xpath ) ) ; } return $ this -> browser -> selectOption ( $ element [ "page_id" ] , $ element [ "ids" ] [ 0 ] , $ value , $ multiple ) ; }
Selects an option
@param string $xpath
@param string $value
@param bool   $multiple
@return bool
@throws DriverException
Selects an option