title: How to get parent of WebElement
body: <p>I've tried </p>
  
  <pre><code>private WebElement getParent(final WebElement webElement) {
      return webElement.findElement(By.xpath(".."));
  }
  </code></pre>
  
  <p>But I'm getting:</p>
  
  <blockquote>
    <p>org.openqa.selenium.InvalidSelectorException: The given selector .. is
    either invalid or does not result in a WebElement. The following error
    occurred:&#10;InvalidSelectorError: The result of the xpath expression
    &quot;..&quot; is: [object XrayWrapper [object HTMLDocument]]. It
    should be an element.&#10;Command duration or timeout: 10
    milliseconds&#10;For documentation on this error,</p>
  </blockquote>
  
  <p>Is there a way to get the parent of current element? Thanks</p>