Xpath2 Bookmarklet

...

Source (www.testingdiaries.com)


Download Bookmarklet:


View Bookmarklet Code:

Bookmarklet Source Code:

javascript%3Afunction%20GetXPATH_final%28%29%20%7B%20var%20currentNode%3Ddocument.selection.createRange%28%29.parentElement%28%29%3B%20var%20path%3D%5B%5D%3B%20while%28currentNode%29%20%7B%20var%20pe%3DgetNode%28currentNode%29%3B%20if%28pe%29%20%7B%20path.push%28pe%29%3B%20if%28pe.indexOf%28%[email protected]%27%29%21%3D-1%29break%3B%20%7D%20currentNode%3DcurrentNode.parentNode%3B%20%7D%20var%20xpath%3D%22/%22+path.reverse%28%29.join%28%27/%27%29%3B%20clipboardData.setData%28%22Text%22%2C%20xpath%29%3B%20%7D%20GetXPATH_final%28%29%3B


Rate it:


Tags:

Comments

Comments so far. Add yours.