Our blog

Selenium RC and self signed certificates

While there are bunch of posts on the web for this issue,It’s so annoying when you face this issue.I spent about half a day to solve this issue even with all the help around it.So for the benefit of someone else here’s what i did

Problem:If you are using a self signed certificate or the web site that you are testing uses an https protocol,there is no way in Selenium to automate the accepting of the certificate part and the browser will always request the user to accept the certificate.Not very helpful if you want to run a suite of tests without manual intervention

Solution:The solution is specific to Firefox and was tested on Windows 7 and Windows XP with FF 3.6

a)In Windows->Start->Run

b)Try one of the following

i)firefox -P no-remote

ii)firefox -ProfileManager no-remote

More information can be found from Firefox help

c)If all goes well,the ProfileManager should open and there should already be a “default” profile.This is the profile used by FF everytime you open a new firefox window   or when Selenium RC launches a firefox window

d)Create a new profile

e)Give the path of this profile like “C:\seleniumprofile” and not the default folder chosen.There is a risk you might mess with the default profile

f)Once done->Select “Do not ask at the startup” and launch your new profile

g)Go to your test site and manually accept the certificate once.To make sure Selenium RC launches this new profile,bookmark a site like cnn.com and close the browser

h)now when you start the selenium server you need to start it like

java -jarselenium-server.jar -firefoxprofiletemplate C:\seleniumprofile

i)Now when you run your tests and the selenium RC launches the browser,quickly make sure it has launched the new profile by going to the bookmarks and verifying it’s has the bookmark added by you.

Also if you want to use your default profile with your normal FF use,open the profile manager once again ,select the default profile and select “do not ask at startup” and launch the browser.you should be all set.

Good luck!!!!

Interested in our Testing Services?

Contact Apexon +1 408-727-1100

By submitting this form, you agree that you have read and understand Apexon’s Terms and Conditions. You can opt-out of communications at any time. We respect your privacy.

Other stories you may enjoy...

Developing an App for the 2020 General Election?

Here is a thought: With the UK General Election having just finished, could the next one in 2020 be the first to use a mobile app to allow people to vote? The polling...

Test Automation for AEM Applications: A Primer

Adobe Experience Manager (AEM) has amassed a loyal following and it is easy to see why. AEM enables web and mobile applications to be built in a way that is quick, easy and...

Can You Simulate Global Conditions in Mobile Testing?

It is no longer enough for an app to solve a particular issue, or perform a useful function, and to assume that users will be satisfied. Apps now offer increasingly complex...