geckodriver 0.15无法使用Firefox 64位

时间:2017-03-16 01:19:10

标签: selenium selenium-webdriver geckodriver

我正在使用selenium Grid在Windows虚拟机上运行测试。

更新为:

  1. geckodriver - v0.15
  2. selenium-server-standalone.jar - v3.3.1
  3. selenium webdriver - v3.3
  4. 我的测试不适用于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)

    我该如何解决这个问题?

2 个答案:

答案 0 :(得分:4)

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

答案 1 :(得分:1)

我在32位GeckoDriver中遇到此错误。我能够通过使用带有GeckoDriver 0.15.0和Selenium 3.3.1的FirefoxOptions类提供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/