afternoon / protractor-browsermob-test

An example which shows how to record network traffic from a Protractor test using BrowserMob Proxy
ISC License
5 stars 3 forks source link

Getting "Error: connect ECONNREFUSED" #3

Open YatheeshKumar opened 9 years ago

YatheeshKumar commented 9 years ago

Hi,

i have cloned this project into my laptop and installed the required npm's.

With the default settings i.e without doing any changes i just executed the "protractor.conf.js" file and got the following error

"Error: connect ECONNREFUSED"

What changes i have to make in this project to work in my laptop and to capture the network traffic. Do i have to run the selenium server if i am configuring these files in the project. Please help me on this.

Thanks, Yatheesh.

qadeerqureshi commented 9 years ago

any update on issue getting same error

YatheeshKumar commented 9 years ago

Have you installed BrowserMob Proxy and do you have it running on your machine? http://bmp.lightbody.net/

qadeerqureshi commented 9 years ago

Yup i have installed browsermob-proxy by running command on node.js command prompt. "npm intall browsermob-proxy" I have just same copy of this code. When i run this code i am getting these errors. You help will be really appreciated thanks!

"C:\Program Files (x86)\JetBrains\WebStorm 11.0.1\bin\runnerw.exe" "C:\Program Files\nodejs\node.exe" lib\cli.js protractor.conf.js Starting selenium standalone server... [launcher] Running 1 instances of WebDriver Selenium standalone server started at http://192.168.1.132:55586/wd/hub onPrepare start failed Started beforeEach browser.params.proxy undefined browser.params.proxyData undefined it afterEach F

Failures: 1) Angular Homepage should greet the named user Message: Failed: Cannot read property 'startHAR' of undefined Stack: TypeError: Cannot read property 'startHAR' of undefined at Object. (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\angularjs-homepage-spec.js:9:25) at c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:92:15 at [object Object].promise.Promise.goog.defineClass.constructor (eval at (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:1123:19), :1056:7) at new wrappedCtr (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:2468:26) at controlFlowExecute (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\nodemodules\jasminewd2\index.js:82:18) at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort.error.executeNext.execute (eval at (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\nodemodules\selenium-webdriver\lib\goog\base.js:1123:19), :2776:14) at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort.error.executeNext_ (eval at (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:1123:19), :2758:21) at goog.async.run.processWorkQueue (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\async\run.js:124:15) at process._tickCallback (node.js:379:9) From: Task: Run beforeEach in control flow at Object. (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:81:14) at attemptAsync (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1819:24) at QueueRunner.run (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1774:9) at QueueRunner.execute (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1762:10) at Spec.Env.queueRunnerFactory (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:627:35) at Spec.execute (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:353:10) at Object.fn (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:2360:37) at attemptAsync (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1819:24) at QueueRunner.run (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1774:9) at QueueRunner.execute (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1762:10) From asynchronous test: Error at Suite. (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\angularjs-homepage-spec.js:5:3) at addSpecsToSuite (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:743:25) at Env.describe (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:713:7) at jasmineInterface.describe (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:3219:18) at Object. (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\angularjs-homepage-spec.js:4:1) Message: Failed: Angular could not be found on the page https://angularjs.org/ : retries looking for angular exceeded Stack: Error: Angular could not be found on the page https://angularjs.org/ : retries looking for angular exceeded at c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\nodemodules\protractor\lib\protractor.js:672:17 at [object Object].promise.Promise.goog.defineClass.invokeCallback (eval at (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\nodemodules\selenium-webdriver\lib\goog\base.js:1123:19), :1337:14) at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort.error.executeNext.execute (eval at (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\nodemodules\selenium-webdriver\lib\goog\base.js:1123:19), :2776:14) at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort.error.executeNext_ (eval at (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:1123:19), :2758:21) at goog.async.run.processWorkQueue (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\async\run.js:124:15) at process._tickCallback (node.js:379:9) From: Task: Run it("should greet the named user") in control flow at Object. (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:81:14) at attemptAsync (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1819:24) at QueueRunner.run (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1774:9) at c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1801:16 at c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1745:9 at Function.next.fail (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1807:9) at c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\nodemodules\jasminewd2\index.js:101:16 at [object Object].promise.Promise.goog.defineClass.invokeCallback (eval at (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\nodemodules\selenium-webdriver\lib\goog\base.js:1123:19), :1337:14) at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort.error.executeNext.execute (eval at (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\nodemodules\selenium-webdriver\lib\goog\base.js:1123:19), :2776:14) at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort.error.executeNext_ (eval at (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:1123:19), :2758:21) From asynchronous test: Error at Suite. (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\angularjs-homepage-spec.js:20:3) at addSpecsToSuite (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:743:25) at Env.describe (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:713:7) at jasmineInterface.describe (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:3219:18) at Object. (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\angularjs-homepage-spec.js:4:1) Message: Failed: Cannot read property 'getHAR' of undefined Stack: TypeError: Cannot read property 'getHAR' of undefined at Object. (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\angularjs-homepage-spec.js:14:25) at c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:92:15 at [object Object].promise.Promise.goog.defineClass.constructor (eval at (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:1123:19), :1056:7) at new wrappedCtr (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:2468:26) at controlFlowExecute (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\nodemodules\jasminewd2\index.js:82:18) at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort.error.executeNext.execute (eval at (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\nodemodules\selenium-webdriver\lib\goog\base.js:1123:19), :2776:14) at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort.error.executeNext_ (eval at (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:1123:19), :2758:21) at goog.async.run.processWorkQueue (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\async\run.js:124:15) at process._tickCallback (node.js:379:9) From: Task: Run afterEach in control flow at Object. (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:81:14) at attemptAsync (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1819:24) at QueueRunner.run (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1774:9) at c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1801:16 at c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1745:9 at Function.next.fail (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1807:9) at c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\nodemodules\jasminewd2\index.js:101:16 at [object Object].promise.Promise.goog.defineClass.invokeCallback (eval at (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\nodemodules\selenium-webdriver\lib\goog\base.js:1123:19), :1337:14) at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort.error.executeNext.execute (eval at (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\nodemodules\selenium-webdriver\lib\goog\base.js:1123:19), :2776:14) at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort.error.executeNext_ (eval at (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:1123:19), :2758:21) From asynchronous test: Error at Suite. (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\angularjs-homepage-spec.js:12:3) at addSpecsToSuite (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:743:25) at Env.describe (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:713:7) at jasmineInterface.describe (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:3219:18) at Object. (c:\Users\A Qadeer Qureshi\AppData\Roaming\npm\node_modules\protractor\angularjs-homepage-spec.js:4:1)

1 spec, 1 failure Finished in 14.772 seconds onComplete Shutting down selenium standalone server. [launcher] 0 instance(s) of WebDriver still running [launcher] chrome #1 failed 1 test(s) [launcher] overall: 1 failed spec(s) [launcher] Process exited with error code 1

Process finished with exit code 1

YatheeshKumar commented 9 years ago

You have to run the Proxy server. download "browsermob-proxy-2.1.0-beta-3" from http://bmp.lightbody.net/. From the downloaded zip file, find "run-browsermob-proxy.bat" inside bin folder. double click on it to start the Proxy. Hope this will help.

qadeerqureshi commented 9 years ago

Thanks Yatheesh Kumar it works like a charm !! :+1:

kalpeshchilka commented 4 years ago

Hi, I am facing a similar issue and cannot run "browsermob-proxy.bat" file since I am working on Mac. Can you please help me with this. Performing following steps:

  1. When running browsermob-proxy executable file, its running by default on port 8080
  2. Running webdriver-manager start, its starts Selenium server on port 4444
  3. Checked in repo, protractor.conf.js - port is mentioned 8888.
  4. npm run test

Please let me know if I'm doing anything wrong and guide me the right path.