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