【问题标题】:geckodriver 0.15 does not work with Firefox 64-bitgeckodriver 0.15 不适用于 Firefox 64 位
【发布时间】:2017-03-16 01:19:10
【问题描述】:

我正在使用 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)

我该如何解决这个问题?

【问题讨论】:

  • 您使用的是 32 位 JRE 吗?另外,检查服务器机器上是否安装了FF。
  • 我使用的是 64 位 JRE,但我使用的是 32 位 geckodriver。 FF 安装在服务器机器上。

标签: selenium selenium-webdriver geckodriver


【解决方案1】:

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

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

【讨论】:

    【解决方案2】:

    我在使用 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/

    【讨论】:

    • 我正在使用网格。有没有办法在节点配置文件上提供二进制位置?
    • 嗨.. 抱歉,我没有使用过 Grid,所以我不确定这个过程
    猜你喜欢
    • 2022-10-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-11
    • 2017-09-03
    • 2018-08-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多