rem: return this.locateElementByIdentifier(locator, inDocument) || this.locateElementByDomTraversal(locator, inDocument) || this.locateElementByXPath(locator, inDocument); 
add: if (locator.startsWith(' return this.locateElementByXPath(locator, inDocument); } if (locator.startsWith('document.')) { return this.locateElementByDomTraversal(locator, inDocument); } return this.locateElementByIdentifier(locator, inDocument); 
context: PageBot = function(pageWindow) {    if (pageWindow) {        this.currentWindow = pageWindow;        this.currentDocument = pageWindow.document;        this.location = pageWindow.location;        this.title = function() {return this.currentDocument.title;};    }    // Register all locateElementBy* functions    // TODO - don't do this in the constructor - only needed once ever    this.locationStrategies = {};    for (var functionName in this) {        var result = /^locateElementBy([A-Z].+)$/.exec(functionName);        if (result != null) {            var locatorFunction = this[functionName];            if (typeof(locatorFunction) != 'function') {                continue;            }            // Use a specified prefix in preference to one generated from            // the function name            var locatorPrefix = locatorFunction.prefix || result[1].toLowerCase();            this.locationStrategies[locatorPrefix] = locatorFunction;        }    }    /**     * Find a locator based on a prefix.     */    this.findElementBy = function(locatorType, locator, inDocument) {        var locatorFunction = this.locationStrategies[locatorType];        if (! locatorFunction) {            throw new SeleniumError("Unrecognised locator type: '" + locatorType + "'");        }        return locatorFunction.call(this, locator, inDocument);    };    /**     * The implicit locator, that is used when no prefix is supplied.     */    this.locationStrategies['implicit'] = function(locator, inDocument) {        return this.locateElementByIdentifier(locator, inDocument)               || this.locateElementByDomTraversal(locator, inDocument)               || this.locateElementByXPath(locator, inDocument);    };    };
meta: 3175	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3175/918f8d394d531142ffd702f7bf13140055e35ee3/selenium-browserbot.js/clean/code/javascript/selenium-browserbot.js