为什么我的 Nightwatch 测试不能使用 selenium?

Why won't my Nightwatch test work with selenium?

我正在使用 nightwatch.js 和 selenium 在远程服务器上测试我的站点。我的守夜人测试在我的本地机器上与我的网站一起工作。当我使用 SVN 将测试签入远程服务器时,它失败了。我收到此错误消息,但我不确定它是什么意思

 Error retrieving a new session from the selenium server:
 { state: 'unhandled error',
sessionId: null,
hCode: 548388426,
value:
    { localizedMessage: 'Unable to connect to host 127.0.0.1 on port 7055  after 45000 ms. Firefox console output:\nedSave.extensions.json\tDEBUG\tStarting write\r\n1429642526359\taddons.manager\tDEBUG\tshutdown\r\n1429642526360\taddons.manager\tDEBUG\tCalling shutdown blocker for XPIProvider\r\n1429642526360\taddons.xpi\tDEBUG\tshutdown\r\n1429642526360\taddons.xpi-utils\tDEBUG\tshutdown\r\n1429642526361\taddons.manager\tDEBUG\tCalling shutdown blocker for LightweightThemeManager\r\n1429642526361\taddons.manager\tDEBUG\tCalling shutdown blocker for GMPProvider\r\n1429642526362\taddons.manager\t
DEBUG\tCalling shutdown blocker for PluginProvider\r\n1429642526439\tDeferredSave.extensions.json\tDEBUG\tWrite succeeded\r\n1429642526440\taddons.xpi
-utils\tDEBUG\tXPI Database saved, setting schema version preference to 16\r\n1429642526440\taddons.xpi\tDEBUG\tNotifying XPI shutdown observers\r\n14
29642526443\taddons.manager\tDEBUG\tAsync provider shutdown done\r\n1429642526618\taddons.manager\tDEBUG\tLoaded provider scope for resource://gre/mod
ules/addons/XPIProvider.jsm: ["XPIProvider"]\r\n1429642526620\taddons.manager\tDEBUG\tLoaded provider scope for resource://gre/modules/LightweightThem
eManager.jsm: ["LightweightThemeManager"]\r\n1429642526623\taddons.xpi\tDEBUG\tstartup\r\n1429642526624\taddons.xpi\tINFO\tMapping fxdriver@googlecode
.com to C:\Users\Thuy\AppData\Local\Temp\2\anonymous1373176543885734633webdriver-profile\extensions\fxdriver@googlecode.com\r\n1429642526624\
taddons.xpi\tDEBUG\tIgnoring file entry whose name is not a valid add-on ID: C:\Users\Thuy\AppData\Local\Temp\2\anonymous1373176543885734633web
driver-profile\extensions\webdriver-staging\r\n1429642526625\taddons.xpi\tINFO\tMapping {972ce4c6-7e08-4474-a285-3208198ce6fd} to C:\Program Files
(x86)\Mozilla Firefox\browser\extensions\{972ce4c6-7e08-4474-a285-3208198ce6fd}\r\n1429642526625\taddons.xpi\tDEBUG\tSkipping unavailable install
location app-system-share\r\n1429642526625\taddons.xpi\tDEBUG\tSkipping unavailable install location app-system-local\r\n1429642526626\taddons.xpi\tDE
BUG\tcheckForChanges\r\n1429642526626\taddons.xpi\tDEBUG\tLoaded add-on state from prefs: {"app-profile":{"fxdriver@googlecode.com":{"d":"C:\\Users\
\\Thuy\\AppData\\Local\\Temp\\2\\anonymous1373176543885734633webdriver-profile\\extensions\\fxdriver@googlecode.com","e":true,"v":"2.44
.0","st":1429642525598,"mt":1429642525568}},"app-global":{"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"d":"C:\\Program Files (x86)\\Mozilla Firefox\
\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}","e":true,"v":"37.0.1","st":1428245410334,"mt":1428245410318}}}\r\n1429642526627\ta
ddons.xpi\tDEBUG\tgetModTime: Recursive scan of fxdriver@googlecode.com\r\n1429642526634\taddons.xpi\tDEBUG\tgetModTime: Recursive scan of {972ce4c6-7
e08-4474-a285-3208198ce6fd}\r\n1429642526634\taddons.xpi\tDEBUG\tgetInstallState changed: false, state: {"app-profile":{"fxdriver@googlecode.com":{"d"
:"C:\\Users\\Thuy\\AppData\\Local\\Temp\\2\\anonymous1373176543885734633webdriver-profile\\extensions\\fxdriver@googlecode.com","e":
true,"v":"2.44.0","st":1429642525598,"mt":1429642525568}},"app-global":{"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"d":"C:\\Program Files (x86)\\Mo
zilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}","e":true,"v":"37.0.1","st":1428245410334,"mt":1428245410318}}}\r\n14
29642526635\taddons.xpi\tDEBUG\tNo changes found\r\n1429642526639\taddons.manager\tDEBUG\tRegistering shutdown blocker for XPIProvider\r\n142964252663
9\taddons.manager\tDEBUG\tRegistering shutdown blocker for LightweightThemeManager\r\n1429642526641\taddons.manager\tDEBUG\tRegistering shutdown block
er for GMPProvider\r\n1429642526641\taddons.manager\tDEBUG\tRegistering shutdown blocker for PluginProvider\r\nJavaScript error: file:///C:/Users/Thuy
/AppData/Local/Temp/2/anonymous1373176543885734633webdriver-profile/extensions/fxdriver@googlecode.com/components/driver-component.js, line 11487: Typ
eError: this.server_ is undefined\r\nJavaScript error: chrome://fxdriver/content/server.js, line 38: NS_ERROR_XPC_CI_RETURNED_FAILURE: Component retur
ned failure code: 0x80570015 (NS_ERROR_XPC_CI_RETURNED_FAILURE) [nsIJSCID.createInstance]\r\n*** Blocklist::_preloadBlocklistFile: blocklist is disabl
ed\r\n1429642527403\taddons.manager\tDEBUG\tRegistering shutdown blocker for <unnamed-provider>\r\n',

它持续了一段时间,但似乎重复了相同的文字

我遇到了同样的问题,对我来说,只需将我的 Selenium 更新到最新版本即可解决此问题。下载:http://www.seleniumhq.org/download/

可能是浏览器驱动版本的问题,我在selenium-conf.js里修改浏览器驱动配置解决了,像这样

//update the chrome version to the lastest (2.25)
driver: {
    chrome: {
        // https://chromedriver.storage.googleapis.com/index.html
        version: '2.25',
        arch: process.arch,
        baseURL: 'https://chromedriver.storage.googleapis.com'
    }
}