Click here to Skip to main content
13,293,950 members (54,858 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


1 bookmarked
Posted 28 Nov 2010

Selenium’s How-To

, 28 Nov 2010
Rate this:
Please Sign up or sign in to vote.
Selenium’s How-To

Recently, I ran into a couple of issues that started affecting some Selenium automated tests I was developing. Below are the issues and solutions implemented:

XHR ERROR: Response_Code = –1 Request Error

When executing the open command, the tests started failing with the following error:

XHR ERROR: URL = https:// Response_Code = -1 Error_Message = Request Error. 
on Firefox version 3.6.12 and Selenium RC version 1.0.3

I found that the issue was reported by other users (issue 408 on Selenium project page). The open command started working again after making the suggested workaround on comment 4, calling the open command and passing the second parameter true:

public void CustomOpen(string url)
    commandProcessor.DoCommand("open", new String[] { url, "true" });

According to comment 4, the issue was caused by a feature that was supposed to be disabled.

The issue seems to be related to that second parameter (ignoreResponseCode) on the open command and the default value assigned when it is null or empty, there are more details about the fix on comment 14. The fix hasn't been released yet, so if you run into this issue you can use this workaround.


When running Selenium on development / test environment, usually there is a need to deal with the certificate exceptions thrown by the browser.

I was experiencing the following behavior when running the tests using *firefoxproxy mode. This mode will remember the certificate exception added but if the site is redirected automatically to another location, Selenium throws permission denied exception (I supposed this is related to Same Origin Policy restriction).

Reading a little further, *firefoxproxy mode is supported only for backward compatibility and *firefox mode should be used in Selenium-RC 1.0 beta 2 and later.

I tried the following solutions mentioned here running Selenium using *firefox mode:

Both approaches worked, but the test execution experiences a small delay when using RCE.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Denmark Denmark
No Biography provided

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171207.1 | Last Updated 28 Nov 2010
Article Copyright 2010 by mariangemarcano
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid