rem: LocatorBuilders.add('positionXPath', function(e) { this.log.debug("positionXPath: e=" + e); var path = ''; var current = e; while (current != null) { var currentPath = '/' + current.nodeName.toLowerCase(); if (current.parentNode != null) { var childNodes = current.parentNode.childNodes; var total = 0; var index = -1; for (var i = 0; i < childNodes.length; i++) { var child = childNodes[i]; if (child.nodeName == current.nodeName) { if (child == current) { index = total; } total++; } } if (total > 1 && index >= 0) { currentPath += '[' + (index + 1) + ']'; 
add: LocatorBuilders.add('domFormElementIndex', function(e) { if (e.form) { var formLocator = this.findDomFormLocator(e.form); var elements = e.form.elements; for (var i = 0; i < elements.length; i++) { if (elements[i] == e) { return formLocator + ".elements[" + i + "]"; 
context: LocatorBuilders.add('positionXPath', function(e) {		this.log.debug("positionXPath: e=" + e);		var path = '';		var current = e;		while (current != null) {			var currentPath = '/' + current.nodeName.toLowerCase();			if (current.parentNode != null) {				var childNodes = current.parentNode.childNodes;				var total = 0;				var index = -1;				for (var i = 0; i < childNodes.length; i++) {					var child = childNodes[i];					if (child.nodeName == current.nodeName) {						if (child == current) {							index = total;						}						total++;					}				}				if (total > 1 && index >= 0) {					currentPath += '[' + (index + 1) + ']';				}			}			path = currentPath + path;			var locator = '/' + path;			if (e == this.findElement(locator)) {				return locator;			}			current = current.parentNode;			this.log.debug("positionXPath: current=" + current);		}		return null;	});
meta: 3428	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3428/c2cf93982c5109588ee388232629f4472d0fba4b/locatorBuilders.js/buggy/src/content/locatorBuilders.js