【问题标题】:which version of firefox do we need for Selenium 3.3.1?Selenium 3.3.1 需要哪个版本的 Firefox?
【发布时间】:2017-03-28 12:22:36
【问题描述】:

Selenium 3.3.1 需要哪个版本的 firefox?我正在尝试将 firefox 51 与 selenium 3.3.1 一起使用,但我无法启动该应用程序,请让我知道我们需要为 selenium 3.3.1 使用哪个浏览器

【问题讨论】:

  • 您使用的是最新版本的壁虎驱动吗? github.com/mozilla/geckodriver/releases
  • 是的 gecko 驱动程序 v15
  • 您能否将 Firefox 更新到 52 并放置您正在使用的实例化代码,如果您使用最新的 geckodriver,则不存在无法使用 3.3.1 启动 Firefox 的已知问题

标签: selenium firefox selenium-webdriver gecko selenium-firefoxdriver


【解决方案1】:

Firefox 51/52 与 GeckoDriver 0.15.0 和 Selenium 3.3.1 配合良好。您需要根据 Firefox 在 Windows 中是 32 位还是 64 位来下载正确版本的 GeckoDriver。此外,您可能需要提供 Firefox 二进制文件,这可以通过 FirefoxOptions 类完成。

    FirefoxOptions options = new FirefoxOptions();
    options.setBinary("C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe");

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

请参阅本文了解更多详情 - http://www.automationtestinghub.com/selenium-3-0-launch-firefox-with-geckodriver/

【讨论】:

    【解决方案2】:

    引用 geckodriver 团队的话:

    在 Firefox 48 及更高版本中得到最好的支持,虽然通常更多 最近的Firefox版本,他们拥有的体验更好 更多错误修复和功能。我们强烈建议使用最新的 Firefox Nightly 与 geckodriver,并希望明确 明确不支持 Firefox 47 及更早版本。从 Windows XP 开始 Firefox 53 将放弃对 Firefox 的支持,我们不支持 这个平台。

    另请参阅:https://github.com/mozilla/geckodriver/blob/master/README.md

    【讨论】:

      【解决方案3】:

      我有一台 Windows 32 位机器。

      Selenium WebDriver - 3.4.0,Selenium.Support - 3.4.0

      Firefox - 54.0(32 位)

      GeckoDriver(32 位)下载并存储在本地 - https://github.com/mozilla/geckodriver/releases

      已安装 Firefox,并提供了“firefox.exe”路径。

      以下启动 Firefox 浏览器的代码:

      FirefoxDriverService service = FirefoxDriverService.CreateDefaultService(@"C:\GeckoDriver");
      service.FirefoxBinaryPath = @"C:\Program Files\Mozilla Firefox\firefox.exe";
      driverInstance = new FirefoxDriver(service);
      

      【讨论】:

        猜你喜欢
        • 2016-08-13
        • 2016-01-06
        • 2018-04-14
        • 1970-01-01
        • 2023-03-29
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-01-29
        相关资源
        最近更新 更多