parent xpath child xpath relationship java selenium code example
Example 1: contains text xpath
//*[contains(text(),'ABC')]
Example 2: retrieving parent element from child aWebelement selenium java
WebElement myElement = driver.findElement(By.id("myDiv"));
WebElement parent = (WebElement) ((JavascriptExecutor) driver).executeScript(
"return arguments[0].parentNode;", myElement);