4

I have researched a lot and used many possible solutions mentioned in the various forums, none of them worked for me. I am trying to run this in CI/CD pipeline although able to run the protractor test cases in local and able to launch the browser but in CI/CD pipeline build it is failing below are the details the issue occurs for protractor 2.5.4 E/launcher - session not created: This version of ChromeDriver only supports Chrome version 79

i am using below postinstall under scripts in package.json

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

for the above script command below error is thrown I/file_manager - creating folder D:\a\1\s\node_modules\protractor\node_modules\webdriver-manager\selenium I/config_source - curl -oD:\a\1\s\node_modules\protractor\node_modules\webdriver-manager\selenium\chrome-response.xml https://chromedriver.storage.googleapis.com/ I/downloader - curl -oD:\a\1\s\node_modules\protractor\node_modules\webdriver-manager\selenium/chromedriver_79.0.3945.36.zip https://chromedriver.storage.googleapis.com/79.0.3945.16/chromedriver_win32.zip I/update - chromedriver: unzipping chromedriver_79.0.3945.36.zip I/launcher - Running 1 instances of WebDriver I/direct - Using ChromeDriver directly... E/launcher - session not created: This version of ChromeDriver only supports Chrome version 79 when i use below script command i get version issue for 76

"postinstall": "webdriver-manager update"

I/update - chromedriver: file exists D:\a\1\s\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_76.0.3809.12.zip I/update - chromedriver: unzipping chromedriver_76.0.3809.12.zip I/update - chromedriver: chromedriver_76.0.3809.12.exe up to date I/launcher - Running 1 instances of WebDriver I/direct - Using ChromeDriver directly... E/launcher - session not created: This version of ChromeDriver only supports Chrome version 76 (Driver info: chromedriver=76.0.3809.12 below is config.json under webdriver-manager

{
   "webdriverVersions": {
   "selenium": "2.53.1",
   "chromedriver": "2.27",
   "maxChromedriver": "77",
   "geckodriver": "v0.13.0",
   "iedriver": "2.53.1",
   "androidsdk": "24.4.1",
   "appium": "1.6.5"
   },
   "cdnUrls": {
   "selenium": "https://selenium-release.storage.googleapis.com/",
   "chromedriver": "https://chromedriver.storage.googleapis.com/",
   "geckodriver": "https://github.com/mozilla/geckodriver/releases/download/",
   "iedriver": "https://selenium-release.storage.googleapis.com/",
   "androidsdk": "http://dl.google.com/android/"
}
}

Tried many commands that might get worked on the pipeline build but none of them is helping me out. Can any one please suggest what could be the possible issue.

user1498069
  • 124
  • 2
  • 14

2 Answers2

8

The below should work (tested on Mac).

npx webdriver-manager update --versions.chrome=$(/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version | cut -d ' ' -f 3)
demouser123
  • 4,108
  • 9
  • 50
  • 82
user3789115
  • 81
  • 1
  • 1
  • this does download the correct driver for Chrome 89 in my case, however, npm run e2e still uses the Chrome 90 driver so this didn't help - +1 for effort tho – danday74 Apr 16 '21 at 09:22
  • 1
    I eventually got this working - had to update protractor.conf.js with ... chromeDriver: '../node_modules/webdriver-manager/selenium/chromedriver_89.0.4389.128' – danday74 Apr 16 '21 at 12:21
2

please mention the version and try to download the chromedriver.

For eg, if chorme version is 79

webdriver-manager update --versions.chrome 79.0.3945.36

If the version is 76,

webdriver-manager update --versions.chrome 76.0.3809.68
dheeraj
  • 324
  • 1
  • 9
  • i have the chome version 78 and i try to install as below : "postinstall": "webdriver-manager update --versions.chrome 78.0.3904.105" it still throws the same error [13:02:33] I/downloader - curl -oD:\a\1\s\node_modules\protractor\node_modules\webdriver-manager\selenium/chromedriver_79.0.3945.36.zip https://chromedriver.storage.googleapis.com/79.0.3945.16/chromedriver_win32.zip I/direct - Using ChromeDriver directly... E/launcher - session not created: This version of ChromeDriver only supports Chrome version 79 (Driver info: chromedriver=79.0.3945.16 – user1498069 Dec 19 '19 at 13:06
  • D:\a\1\s\node_modules\protractor\node_modules\webdriver-manager\selenium/ : From this path, can you delete chromedriver_79 related .zip and .exe files and try again – dheeraj Dec 19 '19 at 13:17
  • this is getting created automatically in pipeline when we do npm i and npm run e2e, it is at the server level in pull request not in local – user1498069 Dec 19 '19 at 13:27
  • Do you have a better idea than hardcoding the version? – Melih May 20 '20 at 12:30