0

package.json

{
  "name": "test1",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "npm run webdriver-update && npm run test-protractor",
    "test-protractor": "protractor protractor.conf.js",
    "webdriver-update": "webdriver-manager update"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "chai": "^4.2.0",
    "chai-as-promised": "^7.1.1",
    "cucumber": "^6.0.5",
    "jasmine-spec-reporter": "^4.2.1",
    "protractor": "^5.4.2",
    "protractor-cucumber-framework": "^6.2.0",
    "rimraf": "^3.0.1"
  }
}

protractor.conf.js

const protractor = require('protractor');

// console.log('browser = ', browser);
exports.config = {
  framework: 'custom',
  frameworkPath: require.resolve('protractor-cucumber-framework'),
  getPageTimeout: 60000,
  allScriptsTimeout: 500000,
  specs: ['features/*.feature'],
  baseURL: 'http://www.google.com/',
  cucumberOpts: {
    require: [
      './features/step_definitions/stepDefinitions.js'
    ],
    tags: false,
    profile: false,
    'no-source': true
  },
  onPrepare: function() {
    // browser.ignoreSynchronization = true;
    // browser.manage().window().maximize();
    // browser.manage().timeouts().implicitlyWait(5000);

  },
  capabilities: {
    browserName: "chrome",
    chromeOptions: {
      args: [
        '--headless',
        '--disaple-gpu',
        '--window-size=1920,1080',
        '--no-sandbox',
        '--disable-dev-shm-usage'
      ],
      prefs: {
        download: {
          prompt_for_download: false,
          extensions_to_open: ''
        },
        profile: {
          default_content_settings: {
            popups: 0
          }
        },
        directory_upgrade: true
      },
      useAutomationExtension: false
    }
  },
  // connec direct to webdriver, instead of local selenium server!
  directConnect: true,
  ignoreUncaughtException: true,
  onComplete: () => {
    // Reporter.createHtmlReport();
  }
}

Error

Session not created: This version of ChromeDriver only supports Chrome version 80

I can manually set update-config.json andhave downloaded many different chromedriver versions, but I still get the same error. Example:

update-config.json

{"standalone":{"last":"node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.141.59.jar","all":["node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.141.59.jar"]},"gecko":{"last":"node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.26.0.exe","all":["node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.26.0.exe"]},"chrome":{"last":"node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_75.0.3770.8.exe","all":["node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_75.0.3770.8.exe","node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_75.0.3770.8.exe"]}}

Error

E/launcher - session not created: This version of ChromeDriver only supports Chrome version 75

This is version 75, so what is happening exactly? I am not using angular. I am using directconnect=true, and set everything to be headless. I did have it working at one point but lost the code and stuck in this loop.

Remy
  • 4,843
  • 5
  • 30
  • 60
Steve Tomlin
  • 3,391
  • 3
  • 31
  • 63
  • Which Chrome browser version have you installed? – Francesco Feb 07 '20 at 10:29
  • the verson of chrome on my operating system - windows 10, is 79.0.3945.130. Though I'm not sure why we would download a chrome driver via webdriver-manager if it were using my local version. Also how would one work this on a docker container? – Steve Tomlin Feb 07 '20 at 14:26
  • You must ensure that the version of the webdriver matches the browser version in your tests environoment. – Francesco Feb 07 '20 at 16:05
  • that doesn't appear to be the case. My answer below now works, and its using chromedriver 78, where as my operating system chrome is version 79. – Steve Tomlin Feb 07 '20 at 16:11

1 Answers1

1

ok, so I have followed the advice from this thread: - protractor 2.5.4 E/launcher - session not created: This version of ChromeDriver only supports Chrome version 79

I am now using chromedriver version: 78.0.3904.105.

  1. node node_modules/protractor/bin/webdriver-manager clean
  2. node node_modules/protractor/bin/webdriver-manager update
  3. node node_modules/protractor/bin/webdriver-manager --versions.chrome=78.0.3904.105
  4. Ensure this version - chromedriver_78.0.3904.105 - is updated in all references in update-config.json file.

update-config.json

{ 
   "standalone":{ 
      "last":"node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.141.59.jar",
      "all":[ 
         "node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.141.59.jar"
      ]
   },
   "gecko":{ 
      "last":"node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.26.0.exe",
      "all":[ 
         "node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.26.0.exe"
      ]
   },
   "chrome":{ 
      "last":"node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_78.0.3904.105.exe",
      "all":[ 
         "node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_78.0.3904.105.exe",
         "node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_78.0.3904.105.exe"
      ]
   }
}

  1. run protractor with option: --no-webdriver-update
  "scripts": {
    "test": "npm run test-protractor --no-webdriver-update"
  },

Now it works!

Steve Tomlin
  • 3,391
  • 3
  • 31
  • 63
  • your workaround is complex and not touch the issue root cause. I saw your another post and know you use docker running testing and build the image upon `nodejs:8`. Firstly, you should get the chrome browser version in the nodejs:8. Then you can know the corresponding chromedrvier version, thus you can specify that version when executing webdriver-manager update like `webdriver-update --version.chrome=`. Then you no need to change the update.json. – yong Feb 08 '20 at 13:51
  • But there is an exception, the chrome browser version is very high, but your protractor is a very low version and its binded webdriver-manger not support install high chromedriver, (this is an know issue) even you specify the chromedriver version in `webdriver-update --version.chrome=..` . If in this case and you can't downgrade the browser version, you can only to use high protractor to enable binded webdriver-manager to get high chromedriver installed. – yong Feb 08 '20 at 13:57
  • And recommend to specify a fix protractor version in package.json, like `"protractor": "5.4.2",` but `"protractor": "^5.4.2",` or `"protractor": "~5.4.2",` This will avoid each npm install will install different version protractor to lead webdriver-manage failed to install desired chromedriver. – yong Feb 08 '20 at 14:00
  • hey if someone offers a better solution I'd gladly take it. the latest version of protractor by the looks of it in npm is: 5.4.3. So it's not exactly an old version of protractor. Yes node 8 is old, and I could update that but don't see the connection with this version and chrome driver. – Steve Tomlin Feb 08 '20 at 17:18
  • Updating your chrome to version 80 could have fixed the issue. @SteveTomlin – Raj Kumar Feb 11 '20 at 05:48
  • chrome version 80 was the beginning of the problem. It was downgrading it as above that worked. – Steve Tomlin Feb 12 '20 at 07:48
  • This solution worked for me (I'm using directConnect). Thanks a lot! – Jan and RESTless Feb 22 '22 at 08:38