Click here to Skip to main content
Click here to Skip to main content
Technical Blog

Tagged as

Selenium’s How-To

, 28 Nov 2010 CPOL
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.

HTTPS Pages

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 use 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.


License

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

Share

About the Author

mariangemarcano

Denmark Denmark
No Biography provided

Comments and Discussions

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