Reputation: 33
I have a question related to testing a website over https with an invalid certificate. Can you please help? I am testing a website on the staging server. It requires https and it uses an invalid cert., which belongs to the production server. So, when I go to the website, FireFox will bring up the 'This Connection is Untrusted page'. I have managed to make firefox skip the page; however, if I don't run it using Selenium (the Python binding), it will show the 'Untrusted' page again. So, I did more research and I found this:
http://code.google.com/p/selenium/wiki/UntrustedSSLCertificates and the port: http://code.google.com/p/selenium/source/detail?r=16168
However, it just doesn't work for me. The following is what I tried:
ff_profile.set_preference("webdriver_accept_untrusted_certs", True)
ff_profile.set_preference("webdriver_assume_untrusted_issuer", True)
self.driver = webdriver.Firefox(ff_profile)
I am using: FireFox 15.0.1 Selenium 2.22
Did I miss anything?
Thanks in advance.
Upvotes: 3
Views: 2475
Reputation: 43
I will re-iterate what user1411110 said, with one change, False instead of 'false'. As string value is braking my webdriver Iceweasel instance.
def setUp(self):
profile = webdriver.firefox.firefox_profile.FirefoxProfile()
profile.default_preferences["webdriver_assume_untrusted_issuer"] = False
profile.update_preferences()
self.driver = webdriver.Firefox(profile)
Upvotes: 2
Reputation: 2247
def setUp(self):
profile = webdriver.firefox.firefox_profile.FirefoxProfile()
profile.default_preferences["webdriver_assume_untrusted_issuer"] = 'false'
profile.update_preferences()
self.driver = webdriver.Firefox(profile)
Upvotes: 1