2017-07-03 59 views
0

量角器不啓動,它甚至不打開鉻。 它只是給了我這個錯誤ENOTFOUND localhost localhost:4444即使我已經開始webdriver-manager,我可以在瀏覽器中訪問localhost:4444。我不知道該怎麼做,我試過重新安裝Chrome,更新量角器& webdriver-manager,升級Node.js,刷新我的DNS,但我仍然有錯誤。量角器:ENOTFOUND getaddrinfo ENOTFOUND localhost localhost:4444

錯誤:

[11:11:21] I/launcher - Running 1 instances of WebDriver 
[11:11:21] I/hosted - Using the selenium server at http://localhost:4444/wd/hub 
[11:11:26] E/launcher - ENOTFOUND getaddrinfo ENOTFOUND localhost localhost:4444 
[11:11:26] E/launcher - Error: ENOTFOUND getaddrinfo ENOTFOUND localhost localhost:4444 
    at ClientRequest.<anonymous> (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:238:15) 
    at emitOne (events.js:115:13) 
    at ClientRequest.emit (events.js:210:7) 
    at Socket.socketErrorListener (_http_client.js:400:9) 
    at emitOne (events.js:115:13) 
    at Socket.emit (events.js:210:7) 
    at emitErrorNT (internal/streams/destroy.js:62:8) 
    at _combinedTickCallback (internal/process/next_tick.js:102:11) 
    at process._tickCallback (internal/process/next_tick.js:161:9) 
From: Task: WebDriver.createSession() 
    at Function.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:777:24) 
    at Function.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/chrome.js:709:29) 
    at createDriver (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:167:33) 
    at Builder.build (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:623:16) 
    at Hosted.getNewDriver (/usr/local/lib/node_modules/protractor/built/driverProviders/driverProvider.js:53:33) 
    at Runner.createBrowser (/usr/local/lib/node_modules/protractor/built/runner.js:195:43) 
    at q.then.then (/usr/local/lib/node_modules/protractor/built/runner.js:339:29) 
    at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:834:54) 
    at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:863:30) 
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:796:13) 
    at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:556:49 
    at runSingle (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:137:13) 
    at flush (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:125:13) 
    at _combinedTickCallback (internal/process/next_tick.js:95:7) 
    at process._tickCallback (internal/process/next_tick.js:161:9) 
    at Function.Module.runMain (module.js:607:11) 
    at startup (bootstrap_node.js:158:16) 
    at bootstrap_node.js:575:3 

這是NPM提供的日誌:

0 info it worked if it ends with ok 
1 verbose cli [ '/usr/local/Cellar/node/8.1.3/bin/node', 
1 verbose cli '/usr/local/bin/npm', 
1 verbose cli 'run', 
1 verbose cli 'tests' ] 
2 info using [email protected] 
3 info using [email protected] 
4 verbose run-script [ 'pretests', 'tests', 'posttests' ] 
5 info lifecycle [email protected]~pretests: [email protected] 
6 silly lifecycle [email protected]~pretests: no script for pretests, continuing 
7 info lifecycle [email protected]~tests: [email protected] 
8 verbose lifecycle [email protected]~tests: unsafe-perm in lifecycle true 
9 verbose lifecycle [email protected]~tests: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/ChrisVillaran/Documents/Projects/angular-app/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/tools:/platform-tools:/Users/ChrisVillaran/.yarn/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/google_appengine/:/usr/local/bin/closure-compiler.jar 
10 verbose lifecycle [email protected]~tests: CWD: /Users/ChrisVillaran/Documents/Projects/angular-app 
11 silly lifecycle [email protected]~tests: Args: [ '-c', 'protractor tests/config.js' ] 
12 silly lifecycle [email protected]~tests: Returned: code: 199 signal: null 
13 info lifecycle [email protected]~tests: Failed to exec tests script 
14 verbose stack Error: [email protected] tests: `protractor tests/config.js` 
14 verbose stack Exit status 199 
14 verbose stack  at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:283:16) 
14 verbose stack  at emitTwo (events.js:125:13) 
14 verbose stack  at EventEmitter.emit (events.js:213:7) 
14 verbose stack  at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14) 
14 verbose stack  at emitTwo (events.js:125:13) 
14 verbose stack  at ChildProcess.emit (events.js:213:7) 
14 verbose stack  at maybeClose (internal/child_process.js:897:16) 
14 verbose stack  at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5) 
15 verbose pkgid [email protected] 
16 verbose cwd /Users/ChrisVillaran/Documents/Projects/angular-app 
17 verbose Darwin 14.5.0 
18 verbose argv "/usr/local/Cellar/node/8.1.3/bin/node" "/usr/local/bin/npm" "run" "tests" 
19 verbose node v8.1.3 
20 verbose npm v5.0.4 
21 error code ELIFECYCLE 
22 error errno 199 
23 error [email protected] tests: `protractor tests/config.js` 
23 error Exit status 199 
24 error Failed at the [email protected] tests script. 
24 error This is probably not a problem with npm. There is likely additional logging output above. 
25 verbose exit [ 199, true ] 

硒日誌:

[14:57:32] I/start - java -Dwebdriver.chrome.driver=/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.30 -Dwebdriver.gecko.driver=/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.17.0 -jar /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.4.0.jar -port 4444 
[14:57:32] I/start - seleniumProcess.pid: 10704 
14:57:33.378 INFO - Selenium build info: version: '3.4.0', revision: 'unknown' 
14:57:33.379 INFO - Launching a standalone Selenium Server 
2017-07-03 14:57:33.443:INFO::main: Logging initialized @590ms to org.seleniumhq.jetty9.util.log.StdErrLog 
14:57:34.065 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: 
    registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform MAC 
14:57:34.065 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped: 
    registration capabilities Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}] does not match the current platform MAC 
14:57:34.065 INFO - Driver class not found: com.opera.core.systems.OperaDriver 
14:57:34.065 INFO - Driver provider com.opera.core.systems.OperaDriver registration is skipped: 
Unable to create new instances on this machine. 
14:57:34.066 INFO - Driver class not found: com.opera.core.systems.OperaDriver 
14:57:34.066 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered 
2017-07-03 14:57:34.188:INFO:osjs.Server:main: jetty-9.4.3.v20170317 
2017-07-03 14:57:34.256:INFO:osjsh.ContextHandler:main: Started [email protected]{/,null,AVAILABLE} 
2017-07-03 14:57:34.321:INFO:osjs.AbstractConnector:main: Started [email protected]{HTTP/1.1,[http/1.1]}{0.0.0.0:4444} 
2017-07-03 14:57:34.322:INFO:osjs.Server:main: Started @1470ms 
14:57:34.322 INFO - Selenium Server is up and running 

附加信息:

Machine: OS X 10.10.5 
Google Chrome: 59.0.3071.115 
Node: 8.1.3 
NPM: 5.0.4 
Protractor: 5.1.2 
Webdriver Manager: 12.0.6 

我的配置:

let SpecReporter = require('jasmine-spec-reporter').SpecReporter; 

exports.config = { 
    allScriptsTimeout: 1000 * 2500, 
    capabilities: { 
    'browserName': 'chrome' 
    }, 
    onPrepare: function() { 
    jasmine.getEnv().addReporter(new SpecReporter({ 
     spec: { 
     displayStacktrace: true 
     } 
    })); 
    }, 
    seleniumAddress: 'http://localhost:4444/wd/hub', 
    specs: [ 
    'tests/specs/login-view/login.js' 
    ], 
    jasmineNodeOpts: { 
    defaultTimeoutInterval: 1000 * 2500, 
    print: function() {} 
    } 
}; 
+0

您提供了幾乎所有的,但不是硒服務器的日誌記錄。你能不能把它粘貼到這裏,以便我們也可以看到當你啓動量角器時發生了什麼? – wswebcreation

+0

好吧,我會編輯我的問題 – CRIS

回答

1

假設你使用OSX,你可能會丟失線路

127.0.0.1 localhost 

從/ etc/hosts中

+0

不錯,它的工作,謝謝。 你可以給我一個解釋或鏈接(用於教育目的) – CRIS

+0

etc/hosts文件將IP地址與主機名相關聯 - localhost是一個主機名,etc/hosts文件重定向到127.0.0.1(環回地址本地機器)。 如果沒有指定localhost,某些應用程序會作出邏輯推理,默認爲重定向到127.0.0.1,但量角器不是其中之一,需要地址在hosts文件中才能工作。 –

+0

好的,非常感謝 – CRIS

0

儘量評論硒地址,波紋管。它應該工作。

//seleniumAddress: 'http://localhost:4444/wd/hub', 
相關問題