This repository has been archived by the owner on Aug 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
HandlingSelfSignedCertificates
Jussi Malinen edited this page Aug 18, 2015
·
1 revision
These instructions explain how to create a custom Firefox profile to test pages using https and self-signed certificates. See CustomFirefoxProfile wiki page for more information about custom profiles.
The solution is copied from http://townx.org/blog/elliot/dealing-self-signed-ssl-certificates-when-running-selenium-server-firefox
- Close down any running Firefox instances.
- Start Firefox (the one you're going to run your tests with) with the profile manager: firefox -ProfileManager
- Create a new profile. You'll be prompted to choose a directory for the profile. Put it somewhere inside the project where you're writing the tests.
- Select the profile and run Firefox using it.
- Browse to the HTTPS URL (with self-signed certificate) you're going to be testing against.
- Accept the self-signed certificate when prompted. This creates an exception for it in the profile.
- Close the browser.
- Go to the Firefox profile directory.
- Delete everything in the directory except for the cert_override.txt and cert8.db files.
- When you run your Selenium server pass a -firefoxProfileTemplate /path/to/profile/dir argument to it. This tells Selenium to use your partial profile (with certificate exceptions) as a basis for minting its new profile. So you get the certificate exceptions, but without any of the other clutter you would get if you used a whole profile.
***Settings***
Library SeleniumLibrary
***Test Case***
Example
Start Selenium Server -firefoxProfileTemplate /home/xx/firefoxprofile
Open Browser https://1.2.3.4/hostedOffice