【问题标题】:Firefox 66.0 and Geckodriver 0.24.0 are not compatible? [duplicate]Firefox 66.0 和 Geckodriver 0.24.0 不兼容? [复制]
【发布时间】:2019-05-27 10:41:11
【问题描述】:

无法启动 Firefox。

试过了 Firefox 66.0 和 Geckodriver geckodriver 0.24.0

使用 Firefox 61.0 和 Geckodriver geckodriver 0.21.0

FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("webdriver.log.driver", "INFO");
profile.setPreference("webdriver.log.file", targetDir + File.separator + "firefoxSeleniumServer.log");
profile.setPreference("browser.download.folderList",2);
profile.setPreference("browser.download.manager.showWhenStarting",false);
profile.setPreference("browser.helperApps.neverAsk.saveToDisk","text/csv;text/plain");
if(platform.equalsIgnoreCase("linux")) {
FirefoxOptions options = new FirefoxOptions();

profile.setPreference("browser.download.dir",System.getProperty("user.dir")+ File.separator + "target");
System.setProperty("webdriver.gecko.driver", "/geckodriver/geckodriver");
System.setProperty("webdriver.firefox.bin","/usr/bin/firefox/firefox");

options.setCapability(CapabilityType.PLATFORM_NAME,Platform.LINUX);
options.setCapability("marionette", true);
options.setCapability("webdriver.firefox.profile",DesiredCapabilities.firefox());
driver = new FirefoxDriver();
}

会话 ID:8d18af2e-b532-4991-af81-d446fb07bb6c 在 sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

原因:java.lang.RuntimeException:分叉进程中出现错误 org.openqa.selenium.NoSuchSessionException

【问题讨论】:

    标签: selenium-webdriver geckodriver selenium-firefoxdriver


    【解决方案1】:

    根据此页面,'https://github.com/mozilla/geckodriver/releases'v0.24.0' 也将支持 65+ 版本。为了克服这些版本问题,您可以尝试'https://github.com/bonigarcia/webdrivermanager',我们不需要为每个浏览器添加/替换 exe 文件。

    【讨论】:

      猜你喜欢
      • 2018-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-05
      相关资源
      最近更新 更多