量角器Js运行到linux机器

时间:2021-06-25 01:21:10

I have protractor tests in my angular project, and when I would like run it i catch next exception log:

我在我的角度项目中有量角器测试,当我想运行它时,我会捕获下一个异常日志:

Possibly unhandled RequestError: Error: connect ECONNREFUSED
    at new RequestError (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/lib/errors.js:11:15)
    at Request.RP$callback [as _callback] (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/lib/rp.js:56:32)
    at self.callback (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/node_modules/request/request.js:198:22)
    at Request.emit (events.js:95:17)
    at Request.onRequestError (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/node_modules/request/request.js:820:8)
    at ClientRequest.emit (events.js:95:17)
    at CleartextStream.socketErrorListener (http.js:1548:9)
    at CleartextStream.emit (events.js:95:17)
    at Socket.onerror (tls.js:1456:17)
    at Socket.emit (events.js:117:20)
    at net.js:441:14
    at process._tickCallback (node.js:448:13)
Possibly unhandled RequestError: Error: connect ECONNREFUSED
    at new RequestError (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/lib/errors.js:11:15)
    at Request.RP$callback [as _callback] (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/lib/rp.js:56:32)
    at self.callback (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/node_modules/request/request.js:198:22)
    at Request.emit (events.js:95:17)
    at Request.onRequestError (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/node_modules/request/request.js:820:8)
    at ClientRequest.emit (events.js:95:17)
    at CleartextStream.socketErrorListener (http.js:1548:9)
    at CleartextStream.emit (events.js:95:17)
    at Socket.onerror (tls.js:1456:17)
    at Socket.emit (events.js:117:20)
    at net.js:441:14
    at process._tickCallback (node.js:448:13)
Possibly unhandled RequestError: Error: connect ECONNREFUSED
    at new RequestError (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/lib/errors.js:11:15)
    at Request.RP$callback [as _callback] (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/lib/rp.js:56:32)
    at self.callback (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/node_modules/request/request.js:198:22)
    at Request.emit (events.js:95:17)
    at Request.onRequestError (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/node_modules/request/request.js:820:8)
    at ClientRequest.emit (events.js:95:17)
    at CleartextStream.socketErrorListener (http.js:1548:9)
    at CleartextStream.emit (events.js:95:17)
    at Socket.onerror (tls.js:1456:17)
    at Socket.emit (events.js:117:20)
    at net.js:441:14
    at process._tickCallback (node.js:448:13)
Possibly unhandled RequestError: Error: connect ECONNREFUSED
    at new RequestError (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/lib/errors.js:11:15)
    at Request.RP$callback [as _callback] (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/lib/rp.js:56:32)
    at self.callback (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/node_modules/request/request.js:198:22)
    at Request.emit (events.js:95:17)
    at Request.onRequestError (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/node_modules/request/request.js:820:8)
    at ClientRequest.emit (events.js:95:17)
    at CleartextStream.socketErrorListener (http.js:1548:9)
    at CleartextStream.emit (events.js:95:17)
    at Socket.onerror (tls.js:1456:17)
    at Socket.emit (events.js:117:20)
    at net.js:441:14
    at process._tickCallback (node.js:448:13)
Possibly unhandled RequestError: Error: connect ECONNREFUSED
    at new RequestError (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/lib/errors.js:11:15)
    at Request.RP$callback [as _callback] (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/lib/rp.js:56:32)
    at self.callback (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/node_modules/request/request.js:198:22)
    at Request.emit (events.js:95:17)
    at Request.onRequestError (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/node_modules/request/request.js:820:8)
    at ClientRequest.emit (events.js:95:17)
    at CleartextStream.socketErrorListener (http.js:1548:9)
    at CleartextStream.emit (events.js:95:17)
    at Socket.onerror (tls.js:1456:17)
    at Socket.emit (events.js:117:20)
    at net.js:441:14
    at process._tickCallback (node.js:448:13)
Possibly unhandled RequestError: Error: connect ECONNREFUSED
    at new RequestError (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/lib/errors.js:11:15)
    at Request.RP$callback [as _callback] (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/lib/rp.js:56:32)
    at self.callback (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/node_modules/request/request.js:198:22)
    at Request.emit (events.js:95:17)
    at Request.onRequestError (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/node_modules/request/request.js:820:8)
    at ClientRequest.emit (events.js:95:17)
    at CleartextStream.socketErrorListener (http.js:1548:9)
    at CleartextStream.emit (events.js:95:17)
    at Socket.onerror (tls.js:1456:17)
    at Socket.emit (events.js:117:20)
    at net.js:441:14
    at process._tickCallback (node.js:448:13)
Possibly unhandled RequestError: Error: connect ECONNREFUSED
    at new RequestError (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/lib/errors.js:11:15)
    at Request.RP$callback [as _callback] (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/lib/rp.js:56:32)
    at self.callback (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/node_modules/request/request.js:198:22)
    at Request.emit (events.js:95:17)
    at Request.onRequestError (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/request-promise/node_modules/request/request.js:820:8)
    at ClientRequest.emit (events.js:95:17)
    at CleartextStream.socketErrorListener (http.js:1548:9)
    at CleartextStream.emit (events.js:95:17)
    at Socket.onerror (tls.js:1456:17)
    at Socket.emit (events.js:117:20)
    at net.js:441:14
    at process._tickCallback (node.js:448:13)
Error: connect ECONNREFUSED
    at errnoException (net.js:905:11)
    at Object.afterConnect [as oncomplete] (net.js:896:19)
[launcher] Process exited with error code 1

/home/tk/WorkSpaceNew/dashboard/frontend/gulp/e2e-tests.js:23
        throw err;
              ^
Error: protractor exited with code 1

Process finished with exit code 8

And before it I see browser window with next url: data:,.

在它之前,我看到浏览器窗口与下一个url:data:,.

UPD protractor.conf.js

'use strict';

var paths = require('./.yo-rc.json')['generator-gulp-angular'].props.paths;

// An example configuration file.
exports.config = {
  // The address of a running selenium server.
  //seleniumAddress: 'http://localhost:4444/wd/hub',
  //seleniumServerJar: deprecated, this should be set on node_modules/protractor/config.json

  // Capabilities to be passed to the webdriver instance.
  capabilities: {
    'browserName': 'chrome'
  },

  // Spec patterns are relative to the current working directly when
  // protractor is called.
  specs: [paths.e2e + '/**/*.js'],

  // Options to be passed to Jasmine-node.
  mochaOpts: {
    timeout: 5000
  },

  framework: 'mocha'
};

UPD2

If I use seleniumAddress: 'http://localhost:4444/wd/hub', I catch next exception:

如果我使用seleniumAddress:'http:// localhost:4444 / wd / hub',我会抓住下一个异常:

Using the selenium server at http://localhost:4444/wd/hub
[launcher] Running 1 instances of WebDriver
ERROR - Unable to start a WebDriver session.

/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:145
      callback(new Error(message));
               ^
Error: ECONNREFUSED connect ECONNREFUSED
    at ClientRequest.<anonymous> (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:145:16)
    at ClientRequest.emit (events.js:95:17)
    at Socket.socketErrorListener (http.js:1548:9)
    at Socket.emit (events.js:95:17)
    at net.js:441:14
    at process._tickCallback (node.js:448:13)
==== async task ====
WebDriver.createSession()
    at Function.webdriver.WebDriver.acquireSession_ (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:149:22)
    at Function.webdriver.WebDriver.createSession (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:123:30)
    at Builder.build (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/builder.js:294:22)
    at DriverProvider.getNewDriver (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/gulp-protractor/node_modules/protractor/lib/driverProviders/driverProvider.js:38:7)
    at Runner.createBrowser (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/gulp-protractor/node_modules/protractor/lib/runner.js:180:37)
    at /home/tk/WorkSpaceNew/dashboard/frontend/node_modules/gulp-protractor/node_modules/protractor/lib/runner.js:257:21
    at _fulfilled (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/gulp-protractor/node_modules/protractor/node_modules/q/q.js:797:54)
    at self.promiseDispatch.done (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/gulp-protractor/node_modules/protractor/node_modules/q/q.js:826:30)
    at Promise.promise.promiseDispatch (/home/tk/WorkSpaceNew/dashboard/frontend/node_modules/gulp-protractor/node_modules/protractor/node_modules/q/q.js:759:13)
[launcher] Process exited with error code 1

/home/tk/WorkSpaceNew/dashboard/frontend/gulp/e2e-tests.js:23
        throw err;
              ^
Error: protractor exited with code 1

Process finished with exit code 8

Help me please run this test in my pc. Thanks a lot.

请帮帮我,请在我的电脑上运行此测试。非常感谢。

1 个解决方案

#1


1  

If you want to connect to that seleniumAddress, you will need to start a selenium server from protractor/bin/webdriver-manager start. If there is no selenium server running, you won't be able to run the test there (ECONNREFUSED).

如果要连接到该seleniumAddress,则需要从protractor / bin / webdriver-manager start启动selenium服务器。如果没有运行selenium服务器,您将无法在那里运行测试(ECONNREFUSED)。

Alternatively you can comment out the seleniumAddress in the config file, use protractor/bin/webdriver-manager update to download the binaries, and protractor will run the tests using the standalone seleniumServerJar.

或者,您可以在配置文件中注释掉seleniumAddress,使用protractor / bin / webdriver-manager更新来下载二进制文件,量角器将使用独立的seleniumServerJar运行测试。

#1


1  

If you want to connect to that seleniumAddress, you will need to start a selenium server from protractor/bin/webdriver-manager start. If there is no selenium server running, you won't be able to run the test there (ECONNREFUSED).

如果要连接到该seleniumAddress,则需要从protractor / bin / webdriver-manager start启动selenium服务器。如果没有运行selenium服务器,您将无法在那里运行测试(ECONNREFUSED)。

Alternatively you can comment out the seleniumAddress in the config file, use protractor/bin/webdriver-manager update to download the binaries, and protractor will run the tests using the standalone seleniumServerJar.

或者,您可以在配置文件中注释掉seleniumAddress,使用protractor / bin / webdriver-manager更新来下载二进制文件,量角器将使用独立的seleniumServerJar运行测试。