Selenium and HTTPS/SSL

18,923

Solution 1

I have tried the solution given by this article (Thanks elliot) and it works well for me! Basically

1. Create a firefox profile:

a. Starting your firefox -ProfileManager (or firefox -P) in cmd.exe (make sure the firefox installation folder path is in your path environment variable, by default it should be just created when you installed firefox) and create a new profile.

b. Select this new profile to browse to the HTTPS URL and accept the self-signed certificate when prompted.

c. Go to the Firefox profile directory.

d. Delete everything in the directory except for the cert_override.txt and cert8.db files.

2. Run your selenium RC server using this profile:

such as java -jar selenium-server.jar -firefoxProfileTemplate c:/Firefox_Profile

Solution 2

If this is an issue with self-signed certificates, you could try using the RCE plugin for Firefox in a custom profile: http://sejq.blogspot.com/2009/01/remember-certificate-exception.html

Internet Explorer's warnings can be disabled through the advanced settings (specifics depend on the version of IE). Worth Googling around for a solution.

For Google Chrome I believe this is an unresolved issue related to: http://code.google.com/p/chromium/issues/detail?id=2010&can=5&colspec=ID%20Stars%20Pri%20Area%20Feature%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS

Share:
18,923
NerdyNick
Author by

NerdyNick

Updated on June 14, 2022

Comments

  • NerdyNick
    NerdyNick almost 2 years

    I'm running selenium-rc 1.0.3 on a Mac OS X & Windows 7 and both seem to be giving my the annoying accept cert error in firefox. In reading the docs they say I should be able to just use the *firefox run mode and rc should take care of it for me via a proxy or something, but this appears to not work. The only solution that I was able to find on the internet was to create a skeleton profile and pass the path into the rc startup, but thats not a real option. As that doesn't solve problems of testing in IE/Chrome/Safari. Does any know of any other solution that will work.

    Selenium-RC docs on HTTPS - http://seleniumhq.org/docs/05_selenium_rc.html#handling-https-and-security-popups

    • NerdyNick
      NerdyNick about 14 years
      As a note the only way that truly worked for FireFix is the creating a default profile with the certs excepted as describe here townx.org/blog/elliot/… However this only appears to work on Windows. Mac appears to the throw exceptions about not being able to load sqllight3.dylib. I have not tried Linux yet however. I am still looking for a solution to IE, Chrome, and Safari.
    • Edward Shtern
      Edward Shtern about 14 years
      I used this method as well. I use the Java client API to do everything from top to bottom, including starting the SeleniumServer, so I needed to also update my Firefox (3.6) settings at Tools > Options > Advanced > Network > Connection > Settings to use a manual proxy configuration of localhost:4444. I also specified the profile template in the Java like so: RemoteControlConfiguration remoteControlConfiguration = new RemoteControlConfiguration(); remoteControlConfiguration.setFirefoxProfileTemplate(new File("<PATH_TO_PROFILE>"));
  • NerdyNick
    NerdyNick about 14 years
    Thanks for the info. Going to try out the FF plugin today. Disappointed to read how Chromium is handling this whole issue though. Left them my own use case in the comments. So hopefully they will see more that they truly do need to support these type of things.
  • Adam
    Adam over 13 years
    +1 I had issues when I deleted everything in the directory and I also needed to go into firefox options and set "Select one automatically" for when a server requests my certificate.