public function isSelected($xpath) {
    $elements = $this->findElement($xpath, 1);
    $javascript = $this->javascriptTemplateRender("is_selected.js.twig", array("xpath" => $xpath));
    $tagName = $this->browser->tagName($elements["page_id"], $elements["ids"][0]);
    if (strcmp(strtolower($tagName), "option") !== 0) {
      throw new DriverException("Can not assert on element that is not an option");
    }

    return $this->browser->evaluate($javascript);
  }
public function isSelected($xpath) {
    $elements = $this->findElement($xpath, 1);
    $javascript = $this->javascriptTemplateRender("is_selected.js.twig", array("xpath" => $xpath));
    $tagName = $this->browser->tagName($elements["page_id"], $elements["ids"][0]);
    if (strcmp(strtolower($tagName), "option") !== 0) {
      throw new DriverException("Can not assert on element that is not an option");
    }

    return $this->browser->evaluate($javascript);
  }
public function isSelected ( $ xpath ) { $ elements = $ this -> findElement ( $ xpath , 1 ) ; $ javascript = $ this -> javascriptTemplateRender ( "is_selected.js.twig" , array ( "xpath" => $ xpath ) ) ; $ tagName = $ this -> browser -> tagName ( $ elements [ "page_id" ] , $ elements [ "ids" ] [ 0 ] ) ; if ( strcmp ( strtolower ( $ tagName ) , "option" ) !== 0 ) { throw new DriverException ( "Can not assert on element that is not an option" ) ; } return $ this -> browser -> evaluate ( $ javascript ) ; }
Checks if the option is selected or not
@param string $xpath
@return bool
@throws DriverException
Checks if the option is selected or not