18

While executing e2e test in concourse, I'm getting the below error, where it looks like the chromedriver is not getting updated. While similar problems were discussing about chrome version falling behind, in my case, the chrome stable version is getting downloaded as expected (76.0.3809.100). But the chromedriver version thats getting pulled by protractor's webmanager driver is stuck in 2.46.

I tried to manually update the chromedriver from 2.46 to 76.0.3809.12, but it was still falling back to 2.46 during execution.

#!/bin/bash

set -e -u -x

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -

sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'

apt-get update && apt-get install -y google-chrome-stable

cd git-platformUI/ui

npm install

npm set progress=false && npm config set depth 0 && npm cache clean --force

$(npm bin)/ng e2e --configuration=$CONFIG

[07:33:13] E/launcher - session not created: Chrome version must be between 71 and 75 (Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 4.15.0-36-generic x86_64) [07:33:13] E/launcher - SessionNotCreatedError: session not created: Chrome version must be between 71 and 75 (Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 4.15.0-36-generic x86_64) at Object.checkLegacyResponse (/tmp/build/357f536d/git-platformUI/ui/node_modules/selenium-webdriver/lib/error.js:546:15) at parseHttpResponse (/tmp/build/357f536d/git-platformUI/ui/node_modules/selenium-webdriver/lib/http.js:509:13) at doSend.then.response (/tmp/build/357f536d/git-platformUI/ui/node_modules/selenium-webdriver/lib/http.js:441:30) at at process._tickCallback (internal/process/next_tick.js:188:7) From: Task: WebDriver.createSession() at Function.createSession (/tmp/build/357f536d/git-platformUI/ui/node_modules/selenium-webdriver/lib/webdriver.js:769:24) at Function.createSession (/tmp/build/357f536d/git-platformUI/ui/node_modules/selenium-webdriver/chrome.js:761:15) at Direct.getNewDriver (/tmp/build/357f536d/git-platformUI/ui/node_modules/protractor/built/driverProviders/direct.js:77:33) at Runner.createBrowser (/tmp/build/357f536d/git-platformUI/ui/node_modules/protractor/built/runner.js:195:43) at q.then.then (/tmp/build/357f536d/git-platformUI/ui/node_modules/protractor/built/runner.js:339:29) at _fulfilled (/tmp/build/357f536d/git-platformUI/ui/node_modules/q/q.js:834:54) at self.promiseDispatch.done (/tmp/build/357f536d/git-platformUI/ui/node_modules/q/q.js:863:30) at Promise.promise.promiseDispatch (/tmp/build/357f536d/git-platformUI/ui/node_modules/q/q.js:796:13) at /tmp/build/357f536d/git-platformUI/ui/node_modules/q/q.js:556:49 at runSingle (/tmp/build/357f536d/git-platformUI/ui/node_modules/q/q.js:137:13) [07:33:13] E/launcher - Process exited with error code 199

Prasanth Mohan
  • 235
  • 1
  • 2
  • 9
  • Have you tried updating webdriver-manager? – jonrsharpe Aug 07 '19 at 08:53
  • Possible duplicate of [When using Protractor 5.4.2, webdriver-manager downloads 2.46 which is not compatible with Chrome 74](https://stackoverflow.com/questions/55910242/when-using-protractor-5-4-2-webdriver-manager-downloads-2-46-which-is-not-compa) – jonrsharpe Aug 07 '19 at 08:54
  • 2
    The solution in the above link did not work for me. But the solution in the github issue https://github.com/angular/protractor/issues/5289 worked for me. "postinstall": "cd ./node_modules/protractor && npm i webdriver-manager@latest && cd ../.. && ./node_modules/.bin/webdriver-manager update" – Prasanth Mohan Aug 07 '19 at 11:00

5 Answers5

11

Delete your node_modules folder, add the below script to your package.json file and npm install. As posted in the comments above and on GitHub

"postinstall": "cd ./node_modules/protractor && npm i webdriver-manager@latest",

Update: The above script started breaking on me once the latest version started changed to webdriver-manager@12.1.7 so I had to be explicit with the version and set it to 12.1.6:

"postinstall": "cd ./node_modules/protractor && npm i webdriver-manager@12.1.6",
Renil Babu
  • 1,232
  • 11
  • 24
Matthew Harrison
  • 790
  • 9
  • 17
  • 1
    Before removing `node_modules` folder, first try runing `cd ./node_modules/protractor && npm i webdriver-manager`... because it worked for me without removing node_modules – Vinay Jeurkar Nov 09 '19 at 05:04
6

Try the below commands:

npm install protractor@5.4.2 --save-dev
ng e2e

It will work and download the latest chrome driver chromedriver_78.0.3904.70.zip.

Renil Babu
  • 1,232
  • 11
  • 24
Hemin Patel
  • 123
  • 1
  • 4
2

Updated the protractor devDependency to latest (5.4.2) worked for me.

pbachman
  • 728
  • 1
  • 6
  • 13
2

In my case, I just installed a missing package and reinstall all deps:

npm i -D webdriver-manager
rm -rf node_modules
npm install

... and run end-to-end tests one more time:

npm run e2e
piecioshka
  • 3,136
  • 1
  • 17
  • 27
0

I had a similar problem that is why I am here, I tired everything until below

npm install chromedriver

Andrew
  • 529
  • 7
  • 8