Selenium and webdriver tests are everywhere these days. They can be often slow and flaky, but you need to run them to make sure you didn’t break anything.
cf.For more information on selenium webdriver, go to selenium webdriver documentation.
Often what I find is I run selenium tests and start doing something as they take time to run. Then the tests are not running. Firefox stopped with certificate error! You have to add the certificate again to run those tests. It happens again and again, and as you are not a machine, you get tired mentally and emotionally. This is my story with selenium tests, so far.
There are a few ways to get around this certificate error. (I can’t say it’s annoying, as it warns you against the fraudulent websites.)
- Remember Certificate Exception add-ons
- With webdriver, set firefox profile to accept untrusted certificates.
- Add your test sites to cert_override.txt
This is a text file gerated in the user profile to store SSL certificate expections, if a user specifies it.
Here is an example.
Files are separated by a tab character, and each line is finished by a line feed character.
1. domainname:port : port 443 for HTTPS (SSL)
2. hash algorithm OID
- SHA1-256: OID.2.16.818.104.22.168.4.2.1 (most used)
- SHA-384: OID.2.16.822.214.171.124.4.2.2
- SHA-512: OID.2.16.8126.96.36.199.4.2.3
3. Certificate fingerprint using previous hash algorithm
4. One or more characters for override type:
- M : allow mismatches in the hostname
- U : allow untrusted certs (whether it’s self signed cert or a missing or invalid issuer cert)
- T : allow errors in the validity time, for example, for expired or not yet valid certs
5. Certificate’s serial number and the issuer name as a base64 encoded string
In order to edit the file, you would have to find the file first, and it was tricky to locate Firefox profile.
If you are on windows 7 or windows server 2008 like me, click on Windows Start and type %APPDATA%\Mozilla\Firefox\Profiles\ in the search box.
If you on a earlier version of windows, please go to a mozilla support page for the profile location.