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
public static String getAbsoluteXPath(WebElement element){ | |
return (String) ((JavascriptExecutor) driver).executeScript( | |
"function absoluteXPath(element) {"+ | |
"var comp, comps = [];"+ | |
"var parent = null;"+ | |
"var xpath = '';"+ | |
"var getPos = function(element) {"+ | |
"var position = 1, curNode;"+ | |
"if (element.nodeType == Node.ATTRIBUTE_NODE) {"+ | |
"return null;"+ |
OlderNewer