【问题标题】:Selenium WebDriver 3.4.0 + geckodriver 0.18.0 + Firefox ?? - which combination works?Selenium WebDriver 3.4.0 + geckodriver 0.18.0 + Firefox ?? - 哪种组合有效?
【发布时间】:2018-01-12 14:25:32
【问题描述】:

我正在使用 .Net 在 Windows Server 2008R2 上运行 Selenium 2.x 和 Firefox 47.0.2。我正在运行 x64 代码。

我正在尝试升级到 Selenium 3.40 + geckdriver 0.18.0,但找不到 100% 运行的 Firefox 版本。除非另有说明,否则我使用的是 x64 en-US 版本的 Firefox。它们是从here 下载的。

这是我发现的:

  • Firefox 51.0.1 - 太旧 - Geckodriver 抱怨“无法找到匹配的功能集”
  • Firefox 52.0.2 - 调用 setPageLoadTimeout 时出现 IndexOutOfBoundException
  • Firefox 52.2.1esr - 调用 setPageLoadTimeout 时出现 IndexOutOfBoundException
  • Firefox 53.0.3 - 退出时,Firefox 窗口保持打开状态,需要手动关闭
  • Firefox 54.0.1(已尝试 x64 和 X86)- 退出时崩溃
  • Firefox 55b9 - 退出时崩溃

是否有适合您在 .Net 上运行的 selenium 3.4.0 + geckodriver + Firefox 组合?

【问题讨论】:

    标签: selenium firefox selenium-webdriver geckodriver


    【解决方案1】:

    自从我们从旧的 Firefox 版本迁移到基于 MarionetteMozilla Firefox 版本(从 Firefox 48)。

    一般来说,每个GeckoDriver 版本都支持每个版本的Mozilla Firefox 版本(从Firefox 48 开始),其中属性marionette 需要设置为true(通过 默认 或通过 DesiredCapabilities() 类的实例进行配置,并在初始化 Web 浏览器时将其作为参数传递)

    如果您使用的是旧的 Firefox 版本(直到 Firefox 47.xGeckoDriver 仍然有效,但您必须明确设置属性 marionettefalse

    最近,GeckoDriverSeleniumMozilla Releases 之间发布了一些依赖关系。 GeckoDriver 发行说明清楚地说明了所有主要/次要的新功能添加增强功能错误修复在这个link单独下载位置


    Selenium 依赖项

    Selenium 3.4.0 现在强烈推荐 Geckodriver v0.16.0

    Selenium 3.3.1 更好地支持Geckodriver v0.15.0


    GeckoDriver 依赖项

    geckodriver v0.18.0 现在推荐 Firefox 53 及更高版本

    geckodriver v0.16.0 仅与 Selenium 3.4 及更高版本兼容。


    答案:

    Selenium 3.5.0 + GeckoDriver 0.18.0 + Firefox 55.0.2 组合最适合我。


    最后更新日期:2017 年 8 月 22 日


    GeckoDriver, Selenium and Firefox Browser compatibility chart

    【讨论】:

    • 它没有完全回答这个问题(尽管我很欣赏快速响应)。那么 Selenium 3.4.0 + Geckodriver 0.16.0 + 某些版本的 Firefox 的组合会起作用吗?有适合您的组合吗?我想使用相当现代的 Firefox 版本。
    • @DebanjanB - 使用您的配置,调用 RemoteWebDriver.Dispose() b 本身会使浏览器窗口打开,但在 Dispose() 之前调用 RemoteWebDriver.Close() 会导致它崩溃(故障模块 xul.dll )。这些结果与 Firefox 53.0.3 相同。如果可行,我可能会尝试使用较旧的 geckodriver 并发布结果。
    • 是否有更新版本的组合可以顺利协同工作? geckodriver 0.21?
    • GeckoDriver 0.20.1, selenium 3.5.0, Firefox 62.0.3, python 2 => [ Firefox ] failed: WebDriverException: Message: Unable to find a matching set of capabilities, 我得到错误结果,有什么建议吗?
    【解决方案2】:

    我发现在 Firefox 53.0.3 或 54.0.1 中使用 Selenium 3.40.0 + geckodriver 0.16.1 对我有用。我没有尝试任何旧版本的 Firefox 或 geckodriver。此外,geckodriver 0.17.0 表现出与 0.18.0 相同的行为 - 在 RemoteWebDriver.Close() 上崩溃 Firefox。

    【讨论】:

      【解决方案3】:

      找到了 WebDriver close + Firefox 崩溃问题的解决方法。这样做:

      firefoxOptions.addPreference("browser.tabs.remote.autostart", 错误的); firefoxOptions.addPreference("browser.tabs.remote.autostart.1", 错误的); firefoxOptions.addPreference("browser.tabs.remote.autostart.2", 假);

      使用

      • GeckoDriver 0.18.0
      • Selenium-Java 3.5.1
      • 火狐 55.0.3

      来源:

      StackoverflowGithub

      【讨论】:

        【解决方案4】:

        FireFox 版本:60.0.2 与 Gecko 驱动版本:0.18.0 硒版本:3.4.0

        【讨论】:

          【解决方案5】:

          我的 EC2 实例不走运,使用 Python3.6、Selenium3.14、geckodriver25/26 和 firefox57/74 我不断收到selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities 有没有人找到兼容版本的 firefox 和 geckodriver 以在 ubuntu 18.04 EC2 实例上运行?

          【讨论】:

            猜你喜欢
            • 2017-04-04
            • 1970-01-01
            • 2018-02-02
            • 1970-01-01
            • 1970-01-01
            • 2021-12-09
            • 1970-01-01
            • 2018-03-31
            • 2021-06-24
            相关资源
            最近更新 更多