Selenium.prototype.getDocType = function(locator, text) {
if(this.browserbot.getCurrentWindow().document.doctype) {
// The page has provided its doctype
var pid=this.browserbot.getCurrentWindow().document.doctype.publicId;
var sid=this.browserbot.getCurrentWindow().document.doctype.systemId;
var typ=this.browserbot.getCurrentWindow().document.doctype.name;
var ret = "<!DOCTYPE " + typ + " PUBLIC " + "\"" + pid + "\" \"" + sid + "\">\n";
ret += "<!-- Doctype automatically detected by Selenium user-extensions.js -->";
return ret;
}
// No doctype was specified - return a default doctype
// TODO Could probably do some manual detection here instead of simply assuming HTML4 Transitional
var doctype = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n";
doctype += "\n<!-- Doctype not detectable so auto-generated by Selenium user-extensions.js -->\n";
return doctype;
};
String doctype = commandProcessor.getString("getDocType", new String[] {} );
Selenium.prototype.getHtmlSource = function() {
/** Returns the entire HTML source between the opening and
* closing "html" tags.
*
* @return string the entire HTML source
*/
return this.browserbot.getDocument().getElementsByTagName("html")[0].innerHTML;
};
Ross
================================================================================================
From: seleniu...@googlegroups.com [mailto:seleniu...@googlegroups.com] On Behalf Of ikent
Sent: Monday, December 13, 2010 7:44 AM
To: seleniu...@googlegroups.com
Subject: [selenium-users] Re: Selenium suite freezing (Re: Retrieve full HTML source via Selenium?)
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.