I\'ve been playing arround with functional testing using Selenium RC.
I keep running into problems when the test goes to the login page of our site and switches to
I have not seen this error with latest version of Selenium RC i.e. 2.31.0
. And if you are using:
RemoteControlConfiguration rc= new RemoteControlConfiguration();
rc.trustAllSSLCertificates();
SeleniumServer server;
server=new SeleniumServer(rc);
IE displays the cert error as a normal html page. Since it does that, you can find the element and do a .click() on it as a temporary workaround. :) You can just create a cert helper class to do it and just execute cert.acceptCert(driver);
For some random reason IE now seems fine so I stick with the configuration as it is and try and sort the FF problems.
This answer doesn't directly answer "Why doesn't Trust All certificates work with IE?", however it does offer an answer to the question that likely gave rise to the question being asked here. i.e. for anyone running Selenium as a Windows Service and find that it does not trust their self-signed certificates.
The Problem
IE does not trust the root and issuing certificates of a self-signing authority and therefore presents a page requesting the user to decide if he/she wants to continue and trust the site. This prevents any selenium tests progressing.
The Solution
The solution is relatively simple and logical in concept, the root and issuing certificates must be installed on the computer as trusted certs.
However, the complexity lies in getting the Windows Service running Selenium RC to trust the certificates if the service runs under a system account. To rectify this, the following steps are required.
Adding certificates to the Trusted Root Certification Authorities store for a local computer
Administrators is the minimum group membership required to complete this procedure.
To add certificates to the Trusted Root Certification Authorities store for a local computer
Adding certificates to the Intermediate Certification Authorities store for a local computer
I have managed to get this to work by setting the -trustAllSSLCertificates and creating a default profile in FireFox.
So far I can happily use either browser w/o fear of the untrusted certificate errors showing up.
its worth noting that the browsers I tell selenium to use are simply *chrome and *iehta.
There are two steps. One is to start the server with the "-trustAllSSLCertificates" option and the other is to configure the browser to use the Selenium server as its proxy. *iexploreproxy and *firefoxproxy handle the proxy settings for you. Selenium (as of 2.0a5) will auto-configure *firefox to use the Selenium server as a proxy if the "-trustAllSSLCertificates" flag is used. *iexplore, using HTA, is never configured by Selenium to use a proxy. So, you'll need to handle that a priori or via a custom launcher.
More details in the following article: http://nirvdrum.com/2010/04/13/how-to-accept-self-signed-ssl-certificates-in-selenium.html