geckodriver 0.15 不适用于 Firefox 64 位

geckodriver 0.15 does not work with Firefox 64-bit

我正在使用 selenium Grid 运行 测试 windows 个虚拟机。

更新后:

  1. geckodriver - v0.15
  2. selenium-server-standalone.jar - v3.3.1
  3. selenium webdriver - v3.3

我的测试不适用于 64 位版本的 Firefox (v52)。我得到以下异常:

Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line (WARNING: The server did not provide any stacktrace information)

我该如何解决这个问题?

用 64 位版本替换 32 位 geckodriver 对我有用。

另一个解决方案是在环境变量下添加 Firefox 文件夹 Path

我在使用 32 位 GeckoDriver 时遇到了这个错误。我能够通过使用 FirefoxOptions class 和 GeckoDriver 0.15.0 和 Selenium 3.3.1 提供 Firefox 位置来解决这个问题 -

    FirefoxOptions options = new FirefoxOptions();
    options.setBinary("C:\Program Files (x86)\Mozilla Firefox\firefox.exe"); //This is the location where you have installed Firefox on your machine

    FirefoxDriver driver = new FirefoxDriver(options);
    driver.get("http://www.google.com");

更多信息在这里 - http://www.automationtestinghub.com/selenium-3-0-launch-firefox-with-geckodriver/