我的 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/