public function isChecked($xpath) {
    $this->findElement($xpath, 1);
    $javascript = $this->javascriptTemplateRender("is_checked.js.twig", array("xpath" => $xpath));
    $checked = $this->browser->evaluate($javascript);

    if ($checked === null) {
      throw new DriverException("Can not check when the element is not checkbox or radio");
    }

    return $checked;
  }