W00t - now have it working on Firefox as well as IE:

PageBot.prototype.bodyText = function() {
    if (!isIE) {
        if (this.currentDocument instanceof XMLDocument) {
            return new XMLSerializer().serializeToString(this.currentDocument);
        } else {
            return getText(this.currentDocument.body);
        }
    } else {
        var xmlDocument = this.currentDocument.XMLDocument;
        if (xmlDocument != null) {
            return xmlDocument.xml;
        } else {
            return getText(this.currentDocument.body);
        }
    }
};


On 11/16/05, Mark Derricutt <[EMAIL PROTECTED]> wrote:
Darn - looks like this breaks on IE :(  Need to investigate that :(


On 11/16/05, Mark Derricutt < [EMAIL PROTECTED] > wrote:
Hey guys,

Ages ago I was asking about testing XML files with selenium and got a "doesn't work" response, well - it does now, and it turned out to be really simple.

I've changed selenium-browserbot.js to use:

PageBot.prototype.bodyText = function() {
    if (this.currentDocument instanceof XMLDocument) {
        return new XMLSerializer().serializeToString(this.currentDocument);
    } else {
        return getText(this.currentDocument.body);
    }
};

This simple checks for an XMLDocument object and serializes it down to a string.  Now I can do things with it like verifyTextPresent.

Mark


_______________________________________________
Selenium-users mailing list
Selenium-users@lists.public.thoughtworks.org
http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users

Reply via email to