Selenium WebDriver不能连接到Firefox 20 [英] Selenium WebDriver does not connect with Firefox 20

查看:159
本文介绍了Selenium WebDriver不能连接到Firefox 20的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用selenium-server-standalone-2.28.0.jar。
启动hub和
使用以下命令启动侦听器
$ b $ pre code>C:\程序文件(x86)\Java\jre7\bin\Java.exe-jar selenium-server-standalone-2.28.0.jar -role webdriver -hub http:// localhost:4444 / grid / register -port 5557 -browserbrowserName = firefox,maxInstances = 5,platform = WINDOWS,javaScriptEnabled = true,TAKES_SCREENSHOT = true



<打开一个空白的Firefox窗口,然后显示以下错误:

 执行
System.InvalidOperationException:无法45000 ms后,连接到端口7055上的主机127.0.0.1。 Firefox控制台输出:
***日志addons.manager:应用程序已升级
*** LOG addons.xpi:启动
*** LOG addons.xpi:跳过不可用的安装位置应用程序-system-local
*** LOG addons.xpi:跳过不可用的安装位置app-system-share
*** LOG addons.xpi:忽略名称不是有效附加ID的文件条目:C:\ Users \ PR〜1.GRO\AppData\Local\Temp\anonymous768293325561108937webdriver-profile\extensions\webdriver-staging
*** LOG addons.xpi:checkForChanges
*** LOG addons.xpi-utils:打开数据库
*** LOG addons.xpi-utils:创建数据库模式
*** LOG addons.xpi:新加载项fxdriver @ googlecode .com安装在应用程序配置文件中
*** Blocklist :: _ loadBlocklistFromFile:禁用blocklist
*** LOG addons.xpi:安装了新的附加组件{972ce4c6-7e08-4474-a285-3208198ce6fd}在应用程序全球
***日志addons.xpi:新的附加fiddlerhook@fiddler2.com安装在winreg-app-glo bal
*** LOG addons.xpi:在winreg-app-global中安装的新增加的avg @工具栏
*** addons.xpi:新增加的附件web2pdfextension@web2pdf.adobedotcom安装在winreg-app-global
*** LOG addons.xpi:更新已安装的附件的更改数据库
*** LOG addons.xpi-utils:更新附加状态
* ** LOG addons.xpi-utils:编写加载项列表
*** LOG addons.manager:shutdown
*** LOG addons.xpi:shutdown
*** LOG插件。 xpi-utils:shutdown
日志addons.xpi-utils:数据库关闭
*** LOG addons.xpi:启动
*** LOG addons.xpi:跳过不可用安装位置app-system-local
*** LOG addons.xpi:跳过不可用的安装位置app-system-share
*** LOG addons.xpi:忽略名称不是有效附件的文件条目ID:C:\ Users \ PR〜1.GRO\AppData\Local\Temp\anonymous768293325561108937webdriver-profile\extensions\webdriver-staging
*** LOG addons.xpi:checkForChanges
*** LOG addons.xpi:没有找到变化
$ b $在OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)在c:\Projects\WebDriver\trunk\dotnet\ src\WebDriver\Remote\RemoteWebDriver.cs:行1002 $ b $在OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute,Dictionary`2参数)在c:\Projects\WebDriver\trunk \dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:第844行
位于c:\Projects\WebDriver\trunk中的OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) \dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:行809 $ b $在OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor,ICapabilities desiredCapabilities)在c:\Projects\ WebDriver \trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:第85行
OpenQA.Selenium.Rem ote.RemoteWebDriver..ctor(Uri remoteAddress,ICapabilities desiredCapabilities,TimeSpan commandTimeout)位于c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:行117 $ b在c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs中的OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress,ICapabilities desiredCapabilities) line 106
at SHL.Test.Selenium.ScreenShotRemoteWebDriver..ctor(Uri remoteAddress,ICapabilities desiredCapabilities)in C:\Preethi\vs1\WebTest\SeleniumWebTest\Framework\SHL.Test.Selenium\\ \\ ScreenShotRemoteWebDriver.cs:第9行
位于C:\Preethi\vs1\WebTest\SeleniumWebTest\Framework中的SHL.Test.Selenium.TestContext..ctor(Action testRun,ITestEnvironment testEnvironment,DesiredCapabilities desiredCapabilities) \SHL.Test.Selenium\TestContext.cs:第31行
SHL.Test.S在C:\Preethi\vs1\WebTest\SeleniumWebTest\Framework\SHL.Test.Selenium\TestBase.cs中的elenium.TestBase.InitSelenium(DesiredCapabilities desiredCapabilities,ITestEnvironment testEnvironment,Action testRun)行:112

关于调试,转到Firefox浏览器附件列表,发现Firefox webDriver与Firefox 20.0 $ b不兼容$ b当前的Firefox webdirver版本是2.28.0

我可以使用哪个最新的Firefox版本,或者是否有这个问题的替代方案?
div class =h2_lin>解决方案

改用最新版本。现在2.32.0



请参阅 http:// docs .seleniumhq.org / download /
或直接下载 http://selenium.googlecode.com/files/selenium-server-standalone-2.32.0.jar



它适用于我


I'm using selenium-server-standalone-2.28.0.jar . Launched the hub and Launched the listener using the following command

"C:\Program Files (x86)\Java\jre7\bin\Java.exe" -jar selenium-server-standalone-2.28.0.jar -role webdriver -hub http://localhost:4444/grid/register -port 5557 -browser "browserName=firefox",maxInstances=5,platform=WINDOWS,javaScriptEnabled=true,TAKES_SCREENSHOT=true

A blank Firefox window is opened and then following error is displayed:

Execute
System.InvalidOperationException: 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\PR~1.GRO\AppData\Local\Temp\anonymous768293325561108937webdriver-profile\extensions\webdriver-staging
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi-utils: Opening database
*** LOG addons.xpi-utils: Creating database schema
*** LOG addons.xpi: New add-on fxdriver@googlecode.com installed in app-profile
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
*** LOG addons.xpi: New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed in app-global
*** LOG addons.xpi: New add-on fiddlerhook@fiddler2.com installed in winreg-app-global
*** LOG addons.xpi: New add-on avg@toolbar installed in winreg-app-global
*** LOG addons.xpi: New add-on web2pdfextension@web2pdf.adobedotcom installed in winreg-app-global
*** 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 addons.manager: shutdown
*** LOG addons.xpi: shutdown
*** LOG addons.xpi-utils: shutdown
*** LOG addons.xpi-utils: Database closed
*** 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\PR~1.GRO\AppData\Local\Temp\anonymous768293325561108937webdriver-profile\extensions\webdriver-staging
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi: No changes found

at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line 1002
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line 844
at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line 809
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line 85
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities, TimeSpan commandTimeout) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line 117
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line 106
at SHL.Test.Selenium.ScreenShotRemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities) in C:\Preethi\vs1\WebTest\SeleniumWebTest\Framework\SHL.Test.Selenium\ScreenShotRemoteWebDriver.cs:line 9
at SHL.Test.Selenium.TestContext..ctor(Action testRun, ITestEnvironment testEnvironment, DesiredCapabilities desiredCapabilities) in C:\Preethi\vs1\WebTest\SeleniumWebTest\Framework\SHL.Test.Selenium\TestContext.cs:line 31
at SHL.Test.Selenium.TestBase.InitSelenium(DesiredCapabilities desiredCapabilities, ITestEnvironment testEnvironment, Action testRun) in C:\Preethi\vs1\WebTest\SeleniumWebTest\Framework\SHL.Test.Selenium\TestBase.cs:line 112

On debugging, went to Firefox browser add-ons list and found that Firefox webDriver is incompatible with Firefox 20.0 Current Firefox webdirver version is 2.28.0

Which latest Firefox version can I use or is there any alternative for this issue?

解决方案

use the latest version instead. for now 2.32.0

see http://docs.seleniumhq.org/download/ or direct download http://selenium.googlecode.com/files/selenium-server-standalone-2.32.0.jar

it works for me

这篇关于Selenium WebDriver不能连接到Firefox 20的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆