selenium webdriver在eclipse里面执行时报错

【问题详情】

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:

@mozilla.com.cn":{"descriptor":"C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\anonymous5902143738151742073webdriver-profile\\extensions\\coba@mozilla.com.cn","mtime":1421223889216,"rdfTime":1400573094000},"commonfix@mozillaonline.com":{"descriptor":"C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\anonymous5902143738151742073webdriver-profile\\extensions\\commonfix@mozillaonline.com.xpi","mtime":1421223889337},"cpmanager@mozillaonline.com":{"descriptor":"C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\anonymous5902143738151742073webdriver-profile\\extensions\\cpmanager@mozillaonline.com","mtime":1421223894324,"rdfTime":1416815244000},"easyscreenshot@mozillaonline.com":{"descriptor":"C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\anonymous5902143738151742073webdriver-profile\\extensions\\easyscreenshot@mozillaonline.com.xpi","mtime":1421223894370},"fxdriver@googlecode.com":{"descriptor":"C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\anonymous5902143738151742073webdriver-profile\\extensions\\fxdriver@googlecode.com","mtime":1421223870791,"rdfTime":1421223870688},"tabimprovelite@mozillaonline.com":{"descriptor":"C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\anonymous5902143738151742073webdriver-profile\\extensions\\tabimprovelite@mozillaonline.com.xpi","mtime":1421223894404},"wx-assistant@mozillaonline.com":{"descriptor":"C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\anonymous5902143738151742073webdriver-profile\\extensions\\wx-assistant@mozillaonline.com.xpi","mtime":1421223894439}}}]
1421223925603    addons.xpi-utils    DEBUG    Opening XPI database C:\Users\ADMINI~1\AppData\Local\Temp\anonymous5902143738151742073webdriver-profile\extensions.json
1421223925609    addons.xpi-utils    DEBUG    Successfully read XPI database
1421223925798    addons.xpi    DEBUG    No changes found
1421223925806    addons.xpi    DEBUG    Registering manifest for C:\Users\ADMINI~1\AppData\Local\Temp\anonymous5902143738151742073webdriver-profile\extensions\commonfix@mozillaonline.com.xpi
1421223925806    addons.xpi    DEBUG    Loading bootstrap scope from C:\Users\ADMINI~1\AppData\Local\Temp\anonymous5902143738151742073webdriver-profile\extensions\commonfix@mozillaonline.com.xpi
1421223925816    addons.xpi    DEBUG    Calling bootstrap method startup on commonfix@mozillaonline.com version 0.9
1421223925896    addons.xpi    DEBUG    Registering manifest for C:\Users\ADMINI~1\AppData\Local\Temp\anonymous5902143738151742073webdriver-profile\extensions\wx-assistant@mozillaonline.com.xpi
1421223925897    addons.xpi    DEBUG    Loading bootstrap scope from C:\Users\ADMINI~1\AppData\Local\Temp\anonymous5902143738151742073webdriver-profile\extensions\wx-assistant@mozillaonline.com.xpi
1421223925904    addons.xpi    DEBUG    Calling bootstrap method startup on wx-assistant@mozillaonline.com version 1.1.2
1421223925991    addons.manager    DEBUG    Registering shutdown blocker for XPIProvider
1421223925992    addons.manager    DEBUG    Registering shutdown blocker for LightweightThemeManager
1421223925996    addons.manager    DEBUG    Registering shutdown blocker for OpenH264Provider
1421223925997    addons.manager    DEBUG    Registering shutdown blocker for PluginProvider
1421223928550    addons.manager    DEBUG    Registering shutdown blocker for <unnamed-provider>
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
System JS : ERROR file:///C:/Users/ADMINI~1/AppData/Local/Temp/anonymous5902143738151742073webdriver-profile/extensions/cpmanager@mozillaonline.com/components/mozCNGuard.js:287 - TypeError: w.gBrowser is null
System JS : WARNING resource://addoninstaller/log4moz.js:494 - mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create
JavaScript error: resource:///modules/sessionstore/SessionStore.jsm, line 1581: NS_ERROR_ILLEGAL_VALUE: Window is not tracked
1421223931829    addons.repository    DEBUG    No addons.json found.
1421223931831    DeferredSave.addons.json    DEBUG    Save changes
1421223931896    DeferredSave.addons.json    DEBUG    Starting timer
1421223933107    DeferredSave.addons.json    DEBUG    Starting write
1421223934552    DeferredSave.addons.json    DEBUG    Write succeeded

    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:118)
    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:246)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:114)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:191)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:182)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:95)
    at Test.Alice.main(Alice.java:19)

【解决方法】firefox和selenium-server-standalone-xx.xx.xx.jar的版本不匹配Selenium  ->FireFox
2.25.0    ->  18
2.30.0    ->  19
2.31.0    ->  20
2.42.2    ->  29

2.42.44  -> 30+





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值