rem: LocatorBuilders.add('hrefXPath', function(e) { if (e.attributes && e.hasAttribute("href")) { href = e.getAttribute("href"); if (href.search(/^http?:\/\ return " } else {  return " 
add: LocatorBuilders.add('attributesXPath', function(e) { const PREFERRED_ATTRIBUTES = ['id','name','value','type','action','onclick'];  function attributesXPath(name, attNames, attributes) { var locator = " for (var i = 0; i < attNames.length; i++) { if (i > 0) { locator += " and "; } var attName = attNames[i]; locator += '@' + attName + "=" + this.attributeValue(attributes[attName]); } locator += "]"; return locator; }  if (e.attributes) { var atts = e.attributes; var attsMap = {}; for (var i = 0; i < atts.length; i++) { var att = atts[i]; attsMap[att.name] = att.value; } var names = [];  for (var i = 0; i < PREFERRED_ATTRIBUTES.length; i++) { var name = PREFERRED_ATTRIBUTES[i]; if (attsMap[name] != null) { names.push(name); var locator = attributesXPath.call(this, e.nodeName.toLowerCase(), names, attsMap); if (e == this.findElement(locator)) { return locator; } } 
context: LocatorBuilders.add('hrefXPath', function(e) {		if (e.attributes && e.hasAttribute("href")) {			href = e.getAttribute("href");			if (href.search(/^http?:\/\//) >= 0) {				return "//a[@href=" + this.attributeValue(href) + "]";			} else {				// use contains(), because in IE getAttribute("href") will return absolute path				return "//a[contains(@href, " + this.attributeValue(href) + ")]";			}		}		return null;	});
meta: 3428	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3428/c2cf93982c5109588ee388232629f4472d0fba4b/locatorBuilders.js/buggy/src/content/locatorBuilders.js