Java Selenium webdriver 无法从 Firefox 26+ 启动

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20897368/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 05:06:00  来源:igfitidea点击:

Selenium webdriver fails to start with Firefox 26+

javafirefoxseleniumselenium-webdriver

提问by Subhrajyoti Majumder

I was using selenium 2.35 with previous versions of firefox before it got updated to version firefox 26.0.My tests were running fine previously but now I end up getting the following error.

在更新到版本 firefox 26.0 之前,我将 selenium 2.35 与以前版本的 firefox 一起使用。我的测试以前运行良好,但现在我最终收到以下错误。

 org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
*** LOG addons.manager: Application has been upgraded
*** LOG addons.xpi: startup
*** LOG addons.xpi: Skipping unavailable install location app-system-local
*** LOG addons.xpi: Skipping unavailable install location app-system-share
*** LOG addons.xpi: Ignoring file entry whose name is not a valid add-on ID: C:\Users\VISHAL~1.SIN\AppData\Local\Temp\anonymous4627406201097696285webdriver-profile\extensions\webdriver-staging
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi-utils: Opening XPI database C:\Users\VISHAL~1.SIN\AppData\Local\Temp\anonymous4627406201097696285webdriver-profile\extensions.json
*** LOG addons.xpi: New add-on [email protected] installed in app-profile
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
*** LOG addons.xpi-utils: Make addon app-profile:[email protected] visible
*** LOG DeferredSave/extensions.json: Save changes
*** LOG DeferredSave/extensions.json: Save changes
*** LOG addons.xpi: New add-on {9F17B1A2-7317-49ef-BCB7-7BB47BDE10F8} installed in winreg-app-user
*** LOG addons.xpi-utils: Make addon winreg-app-user:{9F17B1A2-7317-49ef-BCB7-7BB47BDE10F8} visible
*** LOG DeferredSave/extensions.json: Save changes
*** LOG DeferredSave/extensions.json: Save changes
*** LOG addons.xpi: New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed in app-global
*** LOG addons.xpi-utils: Make addon app-global:{972ce4c6-7e08-4474-a285-3208198ce6fd} visible
*** LOG DeferredSave/extensions.json: Save changes
*** LOG DeferredSave/extensions.json: Save changes
*** LOG addons.xpi: New add-on {9F17B1A2-7317-49ef-BCB7-7BB47BDE10F8} installed in winreg-app-global
*** LOG DeferredSave/extensions.json: Save changes
*** LOG addons.xpi: New add-on [email protected] installed in winreg-app-global
*** LOG addons.xpi-utils: Make addon winreg-app-global:[email protected] visible
*** LOG DeferredSave/extensions.json: Save changes
*** LOG DeferredSave/extensions.json: Save changes
*** LOG addons.xpi: Updating database with changes to installed add-ons
*** LOG addons.xpi-utils: Updating add-on states
*** LOG addons.xpi-utils: Writing add-ons list
*** LOG DeferredSave/extensions.json: Starting timer
*** LOG DeferredSave/extensions.json: Starting write
*** LOG DeferredSave/extensions.json: Write succeeded
*** LOG addons.xpi-utils: XPI Database saved, setting schema version preference to 15
*** LOG addons.manager: shutdown
*** LOG addons.xpi: shutdown
*** LOG addons.xpi-utils: shutdown
*** LOG addons.xpi: Notifying XPI shutdown observers
*** LOG addons.manager: Async provider shutdown done
*** LOG addons.xpi: startup
*** LOG addons.xpi: Skipping unavailable install location app-system-local
*** LOG addons.xpi: Skipping unavailable install location app-system-share
*** LOG addons.xpi: Ignoring file entry whose name is not a valid add-on ID: C:\Users\VISHAL~1.SIN\AppData\Local\Temp\anonymous4627406201097696285webdriver-profile\extensions\webdriver-staging
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi: No changes found
JavaScript error: chrome://browser/content/urlbarBindings.xml, line 654: aUrl is undefined

I tried to downgrade the version of firefox but am unable to get any previous versions from the mozilla site.

我试图降级 firefox 的版本,但无法从 mozilla 站点获得任何以前的版本。

I also tried all the selenium versions 2.36,2.37,2.38,2.39 but none of them seems to be compatible with firefox 26.0. There are errors in the code once I try to replace the selenium 2.35 with 2.36 to 2.39. These errors disappear when I replace again with 2.35.

我还尝试了所有硒版本 2.36、2.37、2.38、2.39,但似乎没有一个与 Firefox 26.0 兼容。一旦我尝试将 selenium 2.35 替换为 2.36 到 2.39,代码中就会出现错误。当我再次用 2.35 替换时,这些错误消失了。

Can anybody help me with the compatible versions of Selenium and Firefox?

有人可以帮助我使用 Selenium 和 Firefox 的兼容版本吗?

采纳答案by Mahesh Reddy Atla

You can use any version of selenium from 2.XX but there is only limitation that we can use only firefox25 or firefox 14.01 to 17.XX

您可以使用 2.XX 中的任何版本的 selenium,但唯一的限制是我们只能使用 firefox25 或 firefox 14.01 到 17.XX

回答by Prasad Din

use firefox 25 , it works fine on FF25

使用 firefox 25 ,它在 FF25 上工作正常

回答by jmccure

Firefox 26 with works with selenium 2.39

Firefox 26 与 selenium 2.39 配合使用

<seleniumVersion>2.39.0</seleniumVersion>

回答by Andrew

The reason for the:

原因如下:

Unable to connect to host 127.0.0.1 on port 7055

无法在端口 7055 上连接到主机 127.0.0.1

error is that the version of Selenium Server does not know how to work with the newer version of Firefox. You need to download a newer version of the Selenium Server that supports the newer version of Firefox.

错误是 Selenium Server 的版本不知道如何使用较新版本的 Firefox。您需要下载支持较新版本 Firefox 的较新版本 Selenium Server。

See: Unable to connect to host 127.0.0.1 on port 7055 at GitHub.

请参阅:无法在 GitHub 的端口 7055 上连接到主机 127.0.0.1