Aurora Ruggieri
Aurora Ruggieri

Reputation: 41

Error 1 during test end to end

I am doing a angular exercise where i have to do a e2e test, when I run the protractor protractor.conf.js i have the following errors:

[launcher] Running 1 instances of WebDriver
(node:3032) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.

C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:108
  var template = new Error(this.message);
                 ^
SessionNotCreatedError: session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"6904.1","isDefault":true},"id":1,"name":"","origin":"://"}
  (Session info: chrome=59.0.3071.86)
  (Driver info: chromedriver=2.19.346078 (6f1f0cde889532d48ce8242342d0b84f94b114a1),platform=Windows NT 10.0 x86_64)
    at new bot.Error (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:108:18)
    at Object.bot.response.checkResponse (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\response.js:109:9)
    at C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:160:24
    at promise.ControlFlow.runInFrame_ (C:/Users/Aurora/AppData/Roaming/npm/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:1857:20)
    at wrappedCtr.notify (C:/Users/Aurora/AppData/Roaming/npm/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2448:25)
    at promise.Promise.notify_ (C:/Users/Aurora/AppData/Roaming/npm/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:564:12)
    at Array.forEach (native)
    at promise.Promise.notifyAll_ (C:/Users/Aurora/AppData/Roaming/npm/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:553:15)
    at goog.async.run.processWorkQueue (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\async\run.js:130:15)
    at <anonymous>
From: Task: WebDriver.createSession()
    at Function.webdriver.WebDriver.acquireSession_ (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:157:22)
    at Function.webdriver.WebDriver.createSession (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:131:30)
    at new Driver (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\chrome.js:810:36)
    at DirectDriverProvider.getNewDriver (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\lib\driverProviders\direct.js:68:16)
    at Runner.createBrowser (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:182:37)
    at C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:263:21
    at _fulfilled (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:797:54)
    at self.promiseDispatch.done (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:826:30)
    at Promise.promise.promiseDispatch (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:759:13)
    at C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:525:49
[launcher] Process exited with error code 1

Can anybody help me to figure out what's wrong?

I attach the file protractor.conf.js and the file that contain all the e2e tests that I execute on the application:

exports.config = {
  allScriptsTimeout: 11000,
  specs: [
    'e2e/*.js'
  ],
  capabilities: {
    'browserName': 'chrome'
  },

  baseUrl: 'http://localhost:3001/',

  framework: 'jasmine',
  directConnect: true,

  jasmineNodeOpts: {
    defaultTimeoutInterval: 30000
  }
};

'use strict';

describe('conFusion App E2E Testing', function() {
  //Introduce the tests into this file
  it('should automatically redirect to / when location hash/fragment is empty', function() {
    browser.get('index.html');
    expect(browser.getLocationAbsUrl()).toMatch("/");
  });

  //Set up a simple test for the index file to check if the page title is set correctly
  describe('index', function() {
    beforeEach(function() {
      browser.get('index.html#/');
    });

    it('should have a title', function() {
      expect(browser.getTitle()).
      toEqual('Ristorante Con Fusion');
    });
  });

  //We will navigate to the first menu item, and test a few properties there
  describe('menu 0 item', function() {
    beforeEach(function() {
      browser.get('index.html#/menu/0');
    });

    it('should have a name', function() {
      var name = element(by.binding('dish.name'));
      expect(name.getText()).
      toEqual('Uthapizza Hot $4.99');
    });

    it('should show the number of comments as', function() {
      expect(element.all(by.repeater('comment in dish.comments'))
        .count()).toEqual(7);

    });

    it('should show the first comment author as', function() {
      element(by.model('critiria')).sendKeys('author');
      expect(element.all(by.repeater('comment in dish.comments'))
        .count()).toEqual(7);
      var author = element.all(by.repeater('comment in dish.comments'))
        .first().element(by.binding('comment.author'));

      expect(author.getText()).toContain('25 Cent');

    });
  });



});


For a reason below, I've added Chromedriver Web Version 2.19 again and installed Chrome version 44, I always get an error:

C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:172 callback(new Error(message)); ^ Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:55368 at ClientRequest.
<anonymous> (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:172:16) at emitOne (events.js:115:13) at ClientRequest.emit (events.js:210:7) at Socket.socketErrorListener (_http_client.js:399: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.webdriver.WebDriver.acquireSession_ (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:157:22) at Function.webdriver.WebDriver.createSession (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:131:30)
  at new Driver (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\chrome.js:810:36) at DirectDriverProvider.getNewDriver (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\lib\driverProviders\direct.js:68:16)
  at Runner.createBrowser (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:182:37) at C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:263:21 at _fulfilled (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:797:54)
  at self.promiseDispatch.done (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:826:30) at Promise.promise.promiseDispatch (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:759:13) at C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:525:49
  [launcher] Process exited with error code 1

Upvotes: 1

Views: 207

Answers (1)

alecxe
alecxe

Reputation: 473873

You are using:

  • Chromedriver version 2.19
  • Chrome version 59

These two are not compatible - you need ChromeDriver 2.30 to work with Chrome 59:

Latest Release: ChromeDriver 2.30

Supports Chrome v58-60

Update your ChromeDriver. Typically done via:

webdriver-manager update

Upvotes: 1

Related Questions