protractor icon indicating copy to clipboard operation
protractor copied to clipboard

Unable to set up debugging

Open sJhonny opened this issue 12 years ago • 3 comments

I've followed the instruction on debugging (https://github.com/angular/protractor/blob/master/docs/debugging.md), both with node debugger and with webstorm, but with no success. In both cases, I just get a console message saying that the node debugger is listening, but my breakpoints aren't being hit.

output from node debugger:

D:\src\apps\j1-test.module>protractor debug conf.js < debugger listening on port 5858 connecting... ok break in C:\Users\j\AppData\Roaming\npm\node_modules\protractor\lib\cli.js:7 5 * Values from command line options override values from the config. 6 */ 7 'use strict'; 8 9 // Coffee is required here to enable config files written in coffee-script. debug> cont < ------------------------------------ < PID: 9756 (capability: chrome #1) < ------------------------------------ < debugger listening on port 5858 debug>

I'm trying to debug example_spec.js:

describe('angularjs homepage', function() {
  it('should greet the named user', function() {
    browser.get('http://www.angularjs.org');
    browser.debugger();
    element(by.model('yourName')).sendKeys('Julie');

    var greeting = element(by.binding('yourName'));

    expect(greeting.getText()).toEqual('Hello Julie!');
  });

any Idea?

P.S. same thing, unanswered, on SO- http://stackoverflow.com/questions/21992414/debugging-protactor-with-without-webstorm

sJhonny avatar Feb 25 '14 12:02 sJhonny

I'm experiencing the same issue. Running a stand-alone selenium server in parallel I'm not seeing any request ever hitting it when watching the logs. Running protractor with the same configuration file but without the debug flag executes the tests as expected.

P.S. If I leave this prompt open it eventually outputs the following message repeated roughly 60 times:

< Failed to open socket on port 5858, waiting 1000 ms before retrying

slucero avatar Feb 25 '14 19:02 slucero

indeed it seems to be the same issue

sJhonny avatar Feb 27 '14 10:02 sJhonny

For those still experiencing this issue as I was:

Failed to open socket on port 5858, waiting 1000 ms before retrying

Turned out I had another process running on that port already. A previous debug gone wrong. After killing it, all is well:

$ ps ax | grep :5858
13387   ??  S      0:00.07 /Users/levithomason/.nvm/v0.10.24/bin/node debug localhost:5858
13941 s003  S+     0:00.00 grep :5858

$ kill 13387
Password:

Props to this SO post.

levithomason avatar Oct 08 '14 08:10 levithomason