Problem: When trying to open a URL using Selenium RC 1.0.3 with Firefox 3.6, the following error is reported through the server log:
XHR ERROR: Response_Code = -1 Error_Message = Request Errorafter which the browser windows disappear and the session is aborted. Interestingly, this only happens when trying to access remote sites, not sites from localhost.
Workaround: This error seems to be caused by something in the Firefox profile template provided with option -firefoxProfileTemplate. I temporarily edited selenium-browserbot.js within the selenium-server.jar to make it ignore the error (new line highlighted in red):
this.isNewPageLoaded = function() {
if (this.pageLoadError) {
LOG.error("isNewPageLoaded found an old pageLoadError");
var e = this.pageLoadError;
this.pageLoadError = null;
throw e;
}
if (self.ignoreResponseCode) {
return self.newPageLoaded;
} else {
if (self.isXhrSent && self.isXhrDone) {
if (self.xhrResponseCode == -1) return self.newPageLoaded;
if (!((self.xhrResponseCode >= 200 &&
self.xhrResponseCode <= 399) ||
self.xhrResponseCode == 0)) {
With this change, the error ceased to be reported. I could no longer reproduce the problem later after removing this temporary fix.
