Selenium WebDriver在Firefox 26+下启动失败

8

我之前使用的是selenium 2.35版本,配合firefox早期版本使用,然而firefox已经升级到26.0版本。我的测试以前都能正常运行,但现在出现以下错误:

 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 fxdriver@googlecode.com installed in app-profile
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
*** LOG addons.xpi-utils: Make addon app-profile:fxdriver@googlecode.com 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 mgsusageagent@managesoft.com installed in winreg-app-global
*** LOG addons.xpi-utils: Make addon winreg-app-global:mgsusageagent@managesoft.com 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

我尝试降级 Firefox 版本,但无法从 Mozilla 网站获得以前的版本。我还尝试了所有的 Selenium 版本2.36、2.37、2.38、2.39,但似乎没有一个与 Firefox 26.0 兼容。一旦我尝试用 Selenium 2.35 替换为 2.36 到 2.39,就会出现代码错误。当我再次替换为 2.35 时,这些错误消失了。有没有人能帮我找到 Selenium 和 Firefox 兼容的版本?

1
您可以在此处查看Firefox的旧版本:http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/ - Suresh Atta
@Suresh Atta,提到的链接无法打开。 - Subhrajyoti Majumder
http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/ - Suresh Atta
在这里添加http前缀。可能是防火墙阻止了连接。 - Suresh Atta
降级你的火狐浏览器并升级你的Webdriver,这将解决你的问题。 - Andrian Durlestean
您可以使用此链接下载 Firefox 的旧版本:http://www.filehippo.com/download_firefox/history/。 - Amith
4个回答

5

您可以使用任何版本的Selenium 2.XX,但我们只能使用Firefox25或Firefox14.01至17.XX版本。请注意,不可更改该限制。


谢谢您提供的信息。请问您能告诉我从哪里下载上述提到的Firefox设置吗? - Subhrajyoti Majumder
Suresh Atta提供的那个似乎无法打开。 - Subhrajyoti Majumder
非常感谢!不幸的是,Firefox 25.00对我来说无法工作;17版本完美适用于我! - eugene.polschikov

5
无法连接到主机127.0.0.1的7055端口的原因是Selenium服务器版本不知道如何与较新版本的Firefox配合工作。您需要下载支持较新版本Firefox的Selenium服务器的更新版本。
请参见:GitHub上无法连接到主机127.0.0.1的7055端口

2

Firefox 26 可与 Selenium 2.39 兼容。

<seleniumVersion>2.39.0</seleniumVersion>

0

使用 Firefox 25,在 FF25 上运行良好。


你能告诉我这个组合吗?我的意思是Firefox 25和Selenium 2.39?或者其他的组合? - Subhrajyoti Majumder
ff 25和selenium 2.25 - Prasad Din

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接