我正在尝试使用以下配置运行自动化脚本。
配置:
Selenium-java 2.53.0
Selenium 服务器 2.53.0
JRE 7 Firefox 49.0
geckodriver-v0.11.1-win64
Firefox 已打开,但脚本无法输入 URL。
请引用以下错误跟踪:
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及更早版本中运行测试)并保持冷静。
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/