Last active
May 9, 2016 07:58
-
-
Save 4M01/6a074e31d7fd82524da7846f4b8821d5 to your computer and use it in GitHub Desktop.
Finding Parent Element of Known Element in Selenium/WebDriver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected WebElement getParentElement(WebElement element){ | |
WebElement parentElement=null; | |
if(element !=null){ | |
parentElement=element.findElement(By.xpath("..")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment