【问题标题】:Selenium FireFox 'This Connection is Untrusted'Selenium FireFox“此连接不受信任”
【发布时间】:2012-11-03 08:57:08
【问题描述】:

我有一个关于使用无效证书通过 https 测试网站的问题。你能帮忙吗?我正在登台服务器上测试一个网站。它需要 https 并且它使用了无效的证书,它属于生产服务器。因此,当我访问该网站时,FireFox 会弹出“此连接不受信任页面”。我设法让Firefox跳过页面;但是,如果我不使用 Selenium(Python 绑定)运行它,它将再次显示“不受信任”页面。所以,我做了更多的研究,我发现了这个:

http://code.google.com/p/selenium/wiki/UntrustedSSLCertificates 和港口: http://code.google.com/p/selenium/source/detail?r=16168

但是,它对我不起作用。以下是我尝试过的:

ff_profile.set_preference("webdriver_accept_untrusted_certs", True)
ff_profile.set_preference("webdriver_assume_untrusted_issuer", True)
self.driver = webdriver.Firefox(ff_profile)

我正在使用: 火狐 15.0.1 硒 2.22

我错过了什么吗?

提前致谢。

【问题讨论】:

  • 我刚刚将我的 Selenium 升级到 2.26,但我仍在重现该问题。

标签: python firefox https selenium-webdriver


【解决方案1】:

我将重申user1411110 所说的内容,但要进行一次更改,将“假”改为“假”。由于字符串值正在制动我的 webdriver Iceweasel 实例。

 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)

【讨论】:

    【解决方案2】:
        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)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-10-10
      • 1970-01-01
      • 1970-01-01
      • 2013-05-28
      • 1970-01-01
      • 2016-05-20
      • 1970-01-01
      相关资源
      最近更新 更多