session not created: Chrome version must be between 71 and 75 - while running angular e2e in Concourse
Asked Answered
G

5

19

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

Galenical answered 7/8, 2019 at 8:51 Comment(3)
Have you tried updating webdriver-manager?Rossen
Possible duplicate of When using Protractor 5.4.2, webdriver-manager downloads 2.46 which is not compatible with Chrome 74Rossen
The solution in the above link did not work for me. But the solution in the github issue 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"Galenical
P
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 [email protected] so I had to be explicit with the version and set it to 12.1.6:

"postinstall": "cd ./node_modules/protractor && npm i [email protected]",
Psi answered 4/9, 2019 at 15:27 Comment(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_modulesLamplighter
E
6

Try the below commands:

npm install [email protected] --save-dev
ng e2e

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

Europeanize answered 25/10, 2019 at 1:24 Comment(1)
protractor is a dev dependency. I think it should be --save-devSacco
D
2

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

Delubrum answered 22/9, 2019 at 12:11 Comment(0)
V
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
Vital answered 22/10, 2019 at 17:14 Comment(0)
S
0

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

npm install chromedriver

Strobotron answered 19/3, 2020 at 7:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.