Meta :-
- 火狐浏览器 v51.0.1(32 位)
- Windows 10
- 硒3.0.1
- Geckodriver Win32 v0.13.0
- Java v1.8.0_71
重现步骤 :-
WebDriver driver = new FirefoxDriver();
driver.get("untrusted/self-signed URL")
堆栈跟踪 :-
org.openqa.selenium.WebDriverException:到达错误页面:about:certerror?e=nssBadCert&u=xxxxxxxx&c=UTF-8&f=regular&d=xxxxxx%20uses%20an%20invalid%20security%20certificate.%0A%0AThe%20certificate%20is%20not %20受信任%20,因为%20it%20是%20自签名的。%0A%20证书%20是%20不是%20对于%20%20名称%20xxxxxx%0A%0AError%20code%3A%20%3Ca%20id%3D%22errorCode%有效%20 22%20标题%3D%22SEC_ERROR_UNKNOWN_ISSUER%22%3ESEC_ERROR_UNKNOWN_ISSUER%3C/a%3E%0A
构建信息:版本:'3.0.1',修订版:'1969d75',时间:'2016-10-18 09:48:19 -0700'
系统信息:主机:'Saurabh-PC',ip:'192.168.3.8',os.name:'Windows 10',os.arch:'x86',os.version:'10.0',java.version:'1.8 .0_71'
驱动程序信息:org.openqa.selenium.firefox.FirefoxDriver
截屏 :-
我也尝试过使用FirefoxProfile
as :-
DesiredCapabilities dc = DesiredCapabilities.firefox();
dc.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
FirefoxProfile profile = new FirefoxProfile();
profile.setAcceptUntrustedCertificates(true);
dc.setCapability(FirefoxDriver.PROFILE, profile);
WebDriver driver = new FirefoxDriver(dc);
driver.get("untrusted/self-signed URL");
但问题和上面是一样的。
已尝试过的参考链接:-
- 如何使用 Selenium 禁用 Firefox 的不可信连接警告? https://stackoverflow.com/questions/16879566/how-to-disable-firefoxs-untrusted-connection-warning-using-selenium
- https://groups.google.com/forum/?fromgroups#!topic/webdriver/frWtNrEwNPk https://groups.google.com/forum/?fromgroups#!topic/webdriver/frWtNrEwNPk
- 使用 WebDriver 处理不受信任的 SSL 证书 https://stackoverflow.com/questions/5933871/handling-untrustedsslcertificates-using-webdriver
根据this bug https://bugzilla.mozilla.org/show_bug.cgi?id=1329965添加了对不受信任/自签名证书的支持错误 1103196 https://bugzilla.mozilla.org/show_bug.cgi?id=1103196并将于开始提供Firefox 52
.
但我找不到任何解决方案Firefox v51.0.1 (32-bit)
.
有什么办法可以使用来解决这个问题Firefox v51.0.1 (32-bit)
?
As in this bug https://bugzilla.mozilla.org/show_bug.cgi?id=1329965提到的对不受信任/自签名证书的支持将从Firefox 52
,我们需要等到Firefox 52
没有被释放。
解决方案 :-目前,作为替代解决方案,我们需要使用现有的Firefox profile
证书在哪里不受信任/自签名网址已经添加到Firefox's exception list
.
如何为 selenium 创建自定义 Firefox 配置文件?
- 需要点击此链接手动创建自定义 Firefox 配置文件 http://toolsqa.com/selenium-webdriver/custom-firefox-profile/
- 手动将不可信/自签名 URL 的证书添加到 Firefox 的例外列表中
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)