Skip to content

Instantly share code, notes, and snippets.

(function(){
function getElementXPath(element) {
if (element && element.id)
return '//*[@id="' + element.id + '"]';
else
return getElementTreeXPath(element);
}
function getElementTreeXPath(element) {
var paths = [];