Selenium + Firefox + HTTPS Selenium + Firefox + HTTPS selenium selenium

Selenium + Firefox + HTTPS


I would suggest an alternative to Selenium.

Have you tried Sahi? It's basically a very similar application, in that it allows scripted browser control, but for a lot of cases it seems to work better than Selenium.

From the Sahi FAQ page:

How does it compare to Selenium?

Sahi is easier to learn and use for testers. Sahi’s recorder works on all browsers. Sahi automatically waits for AJAX and page loads. It does not use XPaths, but uses more intuitive APIs like _in and _near. Sahi works well across frames, iframes, popup windows, sites with dynamic ids, https sites, 401 authentication sites etc. It has inbuilt HTML reports, and ability to run multiple scripts in parallel.

In my experience, this is accurate. There are certain types of browser event that Selenium struggles with, that Sahi handles much better.

I know that doesn't solve your problem with Selenium, and I know it's a pain if you've already written your tests in Selenium to re-do them in Sahi so it may not be the solution you're looking for, but if all else fails, it may be worth considering.

ps - you didn't mention anything about your development environment, but there is a PHP-based testing tool called Mink which integrates with both Sahi and Selenium -- ie you can write the a single test script and have it work in either. I don't know of any similar tool in other languages, but it might be of interest if it helps you migrate between the two.


So the solution turned out to be the 5th point mentioned above.Here are the steps to solve the issue -

1) Download the Remember Certificate Exception xpi file from https://addons.mozilla.org/en-US/firefox/addon/remember-certificate-exception/

2) Unzip it to get a set of files. Keep them in a temporary folder. (temp_folder/extracted_files)

3) Open the install.rdf file and copy the content of em:id node present in the Description node.

4) Rename the temporary folder just created with this copied string.

5) Place this folder under the profile_name/extensions/ directory. Also delete the extensions.cache/.ini/.rdf files from your profile folder. These need to be deleted so as to prevent the user from being prompted that his profile has been changed and that there is a new addon to be installed. Only if the 3 files are deleted, it will be a fully silent install.

This can be automated using a script.

#!/bin/bashmkdir /tmp/addoncp -r ~/POC/remember_certificate_exception-1.0.0-fx.xpi /tmp/addonunzip /tmp/addon/remember_certificate_exception-1.0.0-fx.xpi -d /tmp/addonrm /tmp/addon/remember_certificate_exception-1.0.0-fx.xpifolder_name=$(cat /tmp/addon/install.rdf | grep -m 1 "<em:id>" | cut -f2 -d ">" | cut -f1 -d "<")mv /tmp/addon /tmp/$folder_namecp -r /tmp/$folder_name ~/.mozilla/firefox/*.default/extensionsrm -f ~/.mozilla/firefox/*.default/extensions.


https://addons.mozilla.org/en-US/firefox/addon/skip-cert-error/Use this addon. This will bypass the https errors. This is configurable as well