Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #retrieving #parent #element #child #aWebelement #selenium #java
ADD COMMENT
Topic
Name
3+6 =