java - 如何使用 selenium 2.53.0 在 geckodriver 上使用最新的 Firefox 浏览器运行 selenium 脚本?

标签 java selenium firefox selenium-webdriver geckodriver

我正在尝试使用以下配置运行自动化脚本。

配置:

  • Selenium-java 2.53.0

  • Selenium 服务器 2.53.0

  • JRE 7 Firefox 49.0

  • geckodriver-v0.11.1-win64

Firefox 已打开,但脚本无法输入 URL。

enter image description here

请引用以下错误跟踪:

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
ey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{"32":"icon.png","48":"icon.png"},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Default","description":"The default 
Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi","installDate":1477028214411,"updateDate":1477028214411,"applyBackgroundUpdates":1,"skinnable":true,"size":21905,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"49.0.2","maxVersion":"49.0.2"}],"targetPlatforms":[],"seen":true}
1478243939636   addons.xpi  DEBUG   getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}

如果需要更多信息,请告诉我。

最佳答案

Selenium 2.53.1 及更早版本不适用于 FF 4.7 及更早版本。 您需要将Selenium更新到3.0.2,下载Firefox 47.1及更早版本<下载Gecko驱动程序(在FF 47及更早版本中运行测试)并保持冷静。

Selenium changelog

v3.0.0

IMPORTANT CHANGES

  • Firefox is only fully supported at version 47.0.1 or earlier. Support for later versions of firefox is provided by geckodriver, which is based on the evolving W3C WebDriver spec, and uses the wire protocol in that spec, which is liable to change without notice.
  • You may wish to choose an ESR release such as 45.4.0esr or earlier.
  • Firefox 47.0.0 is not supported at all.

关于java - 如何使用 selenium 2.53.0 在 geckodriver 上使用最新的 Firefox 浏览器运行 selenium 脚本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40417334/

相关文章:

css - 左/右边距在 Chrome 和 Firefox 上的行为不同

css - 为什么 CSS3 透视图在 Firefox 中不起作用

java - struts 2 应用程序无需 JSP 即可呈现结果。这怎么可能?

javascript - TypeError:使用nodejs,selenium和mocha时,test.describe不是函数

c# - 使用变量作为选择器与 Selenium 2 Webdriver by.cssselector

python - Selenium Web 驱动程序使用 POST 请求导航到页面

c# - Internet Explorer 滞后于 IQueryable 数据源。 Firefox 和 Chrome A-OK。提供视频证明

Java 桌面通知 Ubuntu

java - 无法使用 Spring Security 保护 AngularJS 页面

Java SE 版本 <-> Java EE 版本兼容性矩阵