1

I wrote e2e test cases using a protractor. It was working fine a few days before. But now while running the test cases.

I am getting:

session not created: This version of ChromeDriver only supports Chrome version 81 (Driver info: chromedriver=81.0.4044.69

I have already installed Google Chrome version 81. Then also I am getting the same error. I tried re-installing the node_modules but not worked. This the configuration of my protractor.conf.json file:

const { SpecReporter } = require('jasmine-spec-reporter');
const config = require('./protractor.conf').config;
const puppeteer = require('puppeteer');

/**
 * @type { import("protractor").Config }
 */
exports.config = {
  allScriptsTimeout: 11000,
  specs: [
    './src/**/*.e2e-spec.ts'
  ],
  capabilities: {
    browserName: 'chrome',
    chromeOptions: {
      args: [ "--headless", "--no-sandbox" ],
      binary: puppeteer.executablePath()
    },
  },
  directConnect: true,
  baseUrl: 'http://localhost:4200/',
  framework: 'jasmine',
  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 30000,
    print: function() {}
  },
  onPrepare() {
    require('ts-node').register({
      project: require('path').join(__dirname, './tsconfig.json')
    });
    jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
  }
};
halfer
  • 19,824
  • 17
  • 99
  • 186
Nisha
  • 23
  • 4

1 Answers1

1

Because you specify binary: puppeteer.executablePath(), this means protractor will use the browser provided by npm package puppeteer, not the browser installed by yourself.

So the issue is the version of chrome browser provided by 'puppeteer' is not 81. To make it to version 81 or change the chromedriver version to compatible with the current 'puppeteer' chrome browser. Or remove this line binary: puppeteer.executablePath() to rely on the browser which have to pre-installed on test machine manualy.

yong
  • 13,357
  • 1
  • 16
  • 27