【发布时间】:2018-07-19 09:05:24
【问题描述】:
你好(第一次在这里发帖),
我无法让 geckodriver 绕过证书错误。我做了很多研究,并确保我拥有所有组件的最新版本。我之所以强调这是因为该站点上存在的许多过去的问题都讨论了过时的方法,例如使用 DesiredCapabilities。
这是我的代码:
FirefoxDriverService service = FirefoxDriverService.CreateDefaultService();
FirefoxProfile profile = new FirefoxProfile("QA"){
AcceptUntrustedCertificates = true
};
FirefoxOptions options = new FirefoxOptions(){
Profile = profile
};
var driver = new FirefoxDriver(options);
driver.Navigate().GoToUrl("https://google.ca");
上面的代码失败了,我仍然在 Firefox 上遇到证书错误。我在调试时注意到的一件事是驱动程序仍然将“acceptInsecureCerts”功能视为“假”。截图如下。
我做错了吗?请指教。
我目前正在使用:
- Selenium V3.9(最新)
- Mozilla Firefox Nightly 60.0a(最新)
- geckodriver 19.1(最新)
【问题讨论】:
-
以下站点可用于运行所需的快速测试untrusted-root.badssl.com
标签: c# selenium firefox geckodriver