【问题标题】:Selenium-Java automation scripts is not working with Latest version of Firefox browser 63.0.1Selenium-Java 自动化脚本不适用于最新版本的 Firefox 浏览器 63.0.1
【发布时间】:2019-04-16 07:12:58
【问题描述】:

我的 Selenium java V(3.13.0) 脚本在 Firefox v61.0 上运行良好。但在 Firefox 版本 63.0.1 的最新更新后,它停止工作。 我尝试了以下方法,但没有成功。

  1. 下载了Selenium-Java 3.141.0的最新jar
  2. 下载了最新的壁虎驱动(geckodriver-v0.23.0-win64)

如果有人也遇到同样的问题,请分享解决方案。

【问题讨论】:

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


    【解决方案1】:

    尝试更新到 guava-23.0.jar 最新的 jar 文件,我有同样的问题已经解决(确保删除相同 jar 文件的先前版本)。 https://mvnrepository.com/artifact/com.google.guava/guava/23.0

    【讨论】:

      【解决方案2】:

      Firefox 版本 63.0.3 可与最新的 Gecko 驱动程序 geckodriver-v0.23.0 和 Selenium-java 3.141.5 一起正常工作。

      【讨论】:

        【解决方案3】:

        要解决此问题,需要使用最新的 gecko 驱动程序版本“geckodriver-v0.23.0”。我使用 'geckodriver-v0.23.0-win64' 并解决了问题。

        最新版壁虎驱动程序链接:https://github.com/mozilla/geckodriver/releases I use gecko driver version as per attached image.

        【讨论】:

          【解决方案4】:

          这个组合对我有用。

          @Test
          public static void testMF(){
              WebDriver driver;
              System.setProperty("webdriver.gecko.driver","./src/drivers/geckodriver.exe");
              driver=new FirefoxDriver();
              driver.get("https://www.google.com");
          }
          

          我的 maven 写道:

          <dependency>
              <groupId>org.seleniumhq.selenium</groupId>
              <artifactId>selenium-java</artifactId>
              <version>3.141.5</version>
          </dependency>
          <dependency>
              <groupId>org.testng</groupId>
              <artifactId>testng</artifactId>
              <version>6.11</version>
          </dependency>
          <!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
          <dependency>
              <groupId>com.google.guava</groupId>
              <artifactId>guava</artifactId>
              <version>27.0-jre</version>
          </dependency>
          

          我有 Firefox Quantum 63.0.1(64 位)、geckodriver-v0.23.0-win64、Java8。

          【讨论】:

          • 如前所述,我已尝试使用 Selenium-java 3.141.5 和 guava 27.0-jre。 geckodriver-v0.23.0-win64。但仍然没有打开 URL。但是 Firefox 浏览器正在打开,但 URL 未打开。网页显示无法连接。
          • 那么,您在堆栈跟踪中遇到的错误是什么?
          • 实际代码:public static void main(String[] args) { WebDriver driver; System.setProperty("webdriver.gecko.driver","Driver\\geckodriver64bit.exe");驱动程序 = 新的 FirefoxDriver();尝试 { driver.get("google.com"); }catch(Exception e) { System.out.println("Exception Occured"); e.printStackTrace(); } }f
          • org.openqa.selenium.WebDriverException:到达错误页面:about:neterror?e=connectionFailure&u=https%3A//www.google.com/&c=UTF-8&f=regular&d=Firefox%20can %E2%80%99t%20establish%20a%20connection%20to%20the%20server%20at%20www.google.com。构建信息:版本:'3.141.5',修订:'d54ebd709a',时间:'2018-11-06T11:58:41'
          • 功能 {acceptInsecureCerts: true, browserName: firefox, browserVersion: 63.0.1, javascriptEnabled: true, moz:accessibilityChecks: false, moz:geckodriverVersion: 0.23.0, moz:headless: false, moz: processID: 19764, moz:profile: C:\Users\PAVANAGRAWAL\AppDa..., moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, platformVersion: 10.0, 可旋转: false, setWindowRect: true, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior:dismiss and notify}
          猜你喜欢
          • 1970-01-01
          • 2014-02-20
          • 2011-11-30
          • 2010-09-30
          • 2019-06-29
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2017-06-03
          相关资源
          最近更新 更多