0
votes

I've seen this question before but nothing in the answers solved my problems. I am trying to do the protractor tutorial and here is the conf.js file:

// conf.js
exports.config = {
    framework: 'jasmine',
    seleniumAddress: 'http://localhost:4444/wd/hub',
    specs: ['spec.js']
}

Here is the spec.js file:

// spec.js
describe('Protractor Demo App', function() {
    it('should have a title', function() {
        browser.get('http://juliemr.github.io/protractor-demo/');
        expect(browser.getTitle()).toEqual('Super Calculator');
    });
});

I am also getting ERROR100 on running another project, but for simplicity, I'm going to focus on this one project. Here is the error I'm getting:

E/configParser - Error code: 105
E/configParser - Error message: failed loading configuration file conf.js
E/configParser - C:\Workspace\ProtractorCalc\conf.js:6

I know this has to be something with my webdriver/selenium, but I don't know enough to debug it properly. I run webdriver-manager update and webdriver-manager start before running the conf.js file and when I do webdriver-manager start, it looks like it's running, but also prompts me to end webdriver-manager start in order to give me control of the command line:

I/e the last line when running it is "Selenium Server is up and running" but then to be able to type protractor conf.js, I have to enter ctrl+c and I get this back:

Attempting to shut down selenium nicely 
Staying alive until the Selenium Standalone process exists
events.js:163 throw er; //Unhandled 'error' event
Error: read ECONNRESET
     at exports._errnoException (util.js:1050:11)
     at TCP.onread(net.js.581:26)
Terminate batch job (Y/N)?

So is webdriver-manager kicking me out and that's why protractor's conf.js file is failing?

2

2 Answers

1
votes

webdriver-manager start starts the webdriver, as you say, and it is running properly. However, when you press ctrl+c to "regain control", you're actually killing the process. It's at that point that webdriver stops, and that's why protractor won't run.

The easiest way to do this correctly is to open two command windows: run webdriver-manager start in the first one and protractor conf in the second.

0
votes

First the logging refers to the conf.js file. When I look at your file I guess the problem is that you don't provide a capability to run the tests against. In other words, against what browser do you want to run your tests?

Here is an example project which has an example conf.js-file. If you change your file to this I think it should work without a problem

// An example configuration file.
exports.config = {
  seleniumAddress: 'http://localhost:4444/wd/hub',

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

  // Framework to use. Jasmine is recommended.
  framework: 'jasmine',

  // Spec patterns are relative to the current working directory when
  // protractor is called.
  specs: ['spec.js'],

  // Options to be passed to Jasmine.
  jasmineNodeOpts: {
    defaultTimeoutInterval: 30000
  }
};