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