WebDriverError: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms

WebDriverError: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms

Selenium not starting when i run protractor tests in firefox. The dependency version details are specified as below:

Let me know what is going wrong and what am i missing?

节点版本:v4.3.1

量角器版本:3.2.1 业力版本:0.13.21

硒版本:2.52.0 Firefox 版本:47.0.1


Firefox 控制台输出:

C:\Users\tester\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\error.js:27
    super(opt_error);
         ^
WebDriverError: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
MlocE","location":"winreg-app-global","version":"15.1.0","type":"extension","internalName":null,"updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{},"iconURL":"chrome://vscore/content/ScriptFF.gif","icon64URL":null,"defaultLocale":{"name":"McAfee ScriptScan for Firefox","description":null,"creator":"McAfee, Inc.","homepageURL":null},"visible":true,"active":false,"userDisabled":true,"appDisabled":false,"descriptor":"C:\Program Files (x86)\Common Files\McAfee\SystemCore","installDate":1465363824840,"updateDate":1465363824840,"applyBackgroundUpdates":1,"bootstrap":false,"skinnable":false,"size":2695168,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":true,"hasBinaryComponents":false,"strictCompatibility":false,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"1.5","m
1467645009572   DeferredSave.extensions.json    DEBUG   Save changes
1467645009572   addons.xpi      DEBUG   Updating database with changes to installed add-ons
1467645009572   addons.xpi-utils        DEBUG   Updating add-on states
1467645009579   addons.xpi-utils        DEBUG   Writing add-ons list
1467645009586   addons.xpi      DEBUG   Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\e10srollout@mozilla.org.xpi
1467645009587   addons.xpi      DEBUG   Calling bootstrap method startup on e10srollout@mozilla.org version 1.0
1467645009587   addons.xpi      DEBUG   Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\firefox@getpocket.com.xpi
1467645009588   addons.xpi      DEBUG   Calling bootstrap method startup on firefox@getpocket.com version 1.0.2
1467645009589   addons.xpi      DEBUG   Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\loop@mozilla.org.xpi
1467645009590   addons.xpi      DEBUG   Calling bootstrap method startup on loop@mozilla.org version 1.3.2
1467645009609   addons.manager  DEBUG   Registering shutdown blocker for XPIProvider
1467645009609   addons.manager  DEBUG   Provider finished startup: XPIProvider
1467645009610   addons.manager  DEBUG   Starting provider: LightweightThemeManager
1467645009610   addons.manager  DEBUG   Registering shutdown blocker for LightweightThemeManager
1467645009610   addons.manager  DEBUG   Provider finished startup: LightweightThemeManager
1467645009610   addons.manager  DEBUG   Starting provider: GMPProvider
1467645009616   addons.manager  DEBUG   Registering shutdown blocker for GMPProvider
1467645009617   addons.manager  DEBUG   Provider finished startup: GMPProvider
1467645009617   addons.manager  DEBUG   Starting provider: PluginProvider
1467645009617   addons.manager  DEBUG   Registering shutdown blocker for PluginProvider
1467645009617   addons.manager  DEBUG   Provider finished startup: PluginProvider
1467645009618   addons.manager  DEBUG   Completed startup sequence
1467645009955   addons.manager  DEBUG   Starting provider: <unnamed-provider>
1467645009955   addons.manager  DEBUG   Registering shutdown blocker for <unnamed-provider>
1467645009955   addons.manager  DEBUG   Provider finished startup: <unnamed-provider>
1467645010210   DeferredSave.extensions.json    DEBUG   Write succeeded
1467645010210   addons.xpi-utils        DEBUG   XPI Database saved, setting schema version preference to 17
1467645010210   DeferredSave.extensions.json    DEBUG   Starting timer
1467645010247   DeferredSave.extensions.json    DEBUG   Starting write
1467645010259   addons.repository       DEBUG   No addons.json found.
1467645010260   DeferredSave.addons.json        DEBUG   Save changes
1467645010263   DeferredSave.addons.json        DEBUG   Starting timer
1467645010426   addons.manager  DEBUG   Starting provider: PreviousExperimentProvider
1467645010426   addons.manager  DEBUG   Registering shutdown blocker for PreviousExperimentProvider
1467645010426   addons.manager  DEBUG   Provider finished startup: PreviousExperimentProvider
1467645010431   DeferredSave.addons.json        DEBUG   Starting write
1467645010455   DeferredSave.extensions.json    DEBUG   Write succeeded
1467645010505   DeferredSave.addons.json        DEBUG   Write succeeded

    at WebDriverError (C:\Users\tester\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\error.js:27:10)
    at Object.checkLegacyResponse (C:\Users\tester\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\error.js:580:13)
    at C:\Users\tester\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:64:13
    at Promise.invokeCallback_ (C:\Users\tester\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:1329:14)
    at TaskQueue.execute_ (C:\Users\tester\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2790:14)
    at TaskQueue.executeNext_ (C:\Users\tester\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2773:21)
    at C:\Users\tester\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2652:27
    at C:\Users\tester\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:639:7
    at process._tickCallback (node.js:364:9)
From: Task: WebDriver.createSession()
    at acquireSession (C:\Users\tester\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:62:22)
    at Function.createSession (C:\Users\tester\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:295:12)
    at Builder.build (C:\Users\tester\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\builder.js:458:24)
    at [object Object].DriverProvider.getNewDriver (C:\Users\tester\AppData\Roaming\npm\node_modules\protractor\built\driverProviders\driverProvider.js:42:27)
    at [object Object].Runner.createBrowser (C:\Users\tester\AppData\Roaming\npm\node_modules\protractor\built\runner.js:203:37)
    at C:\Users\tester\AppData\Roaming\npm\node_modules\protractor\built\runner.js:293:21
    at _fulfilled (C:\Users\tester\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:834:54)
    at self.promiseDispatch.done (C:\Users\tester\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:863:30)
    at Promise.promise.promiseDispatch (C:\Users\tester\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:796:13)
    at C:\Users\tester\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:604:44
[launcher] Process exited with error code 1

Firefox 47 有 compatibility issues with the selenium webdriver 2.53 (you have 2.52, but I think it is still a problem). You need to either downgrade Firefox to 46.0.1 或安装包含修复程序的 最新开发版本 Firefox。

Or/and,你应该将 Protractor 升级到最新版本(目前是 3.3.0),这将带来最新的 selenium-webdriver 包(注意:Protractor 尝试与 selenium-webdriver 中的最新更新同步,但特别是 3.3.0 depends on the same 2.52.0, while there is 2.53.2 out there - the next 3.4.0 will have that installed)。