java - Firefox 错误 : "Your connection is not secure" while launching driver with Selenium 3. 0.1 使用 Java

标签 java selenium firefox ssl geckodriver

我的 Firefox 版本是 46.0.1,Selenium 版本是 3.0.1。 我收到错误:

Your connection is not secure

执行以下代码时:

    @Test
public void test() {
    ProfilesIni profile = new ProfilesIni();
    FirefoxProfile ffProfile = profile.getProfile("newCretedProfile");
    ffProfile.setAcceptUntrustedCertificates(true);
    ffProfile.setAssumeUntrustedCertificateIssuer(false);
    System.setProperty("webdriver.gecko.driver", "D:\\SELENUIUM\\Drivers\\geckodriver.exe");
    FirefoxDriver driver = new FirefoxDriver(ffProfile);
    driver.get("http://www.google.com");
    driver.quit();
}

我已经创建了新的 firefox 配置文件并按照此 url 中的步骤操作

然而,当我启动任何网站时,它不起作用并给我同样的错误。

最佳答案

下载 Firefox 55 beta 并设置

capabilities.setCapability("acceptInsecureCerts", true);

这是我的适用于 Firefox 55 beta 的代码:

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setBrowserName("firefox");
capabilities.setCapability("acceptInsecureCerts", true);
RemoteWebDriver driver = new RemoteWebDriver(Environment.remoteWebDriverURL, capabilities);

关于java - Firefox 错误 : "Your connection is not secure" while launching driver with Selenium 3. 0.1 使用 Java,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40467460/

相关文章:

python - 使用 Selenium : How to keep logged in after closing Driver in Python in whatsapp

selenium - Chrome 的 useAutomationExtension 功能是什么?

html - 子 XPath 轴和后代 XPath 轴有什么区别?

java - 为什么这个 Java servlet url-pattern/RequestMapping 不起作用?

css - Roboto 压缩字体无法在 mozilla firefox 中正确呈现

firefox - 说服 Firefox 通过 HTTPS 发送 If-Modified-Since header

css - Firefox 和 Chrome 中的水平列表项宽度不同

java - 如何在 NetBeans 中使用 Tess4j

java - 如何将数组列表接受到方法中

java - 使用 LWJGL 在 glDrawElements 中偏移