angular / webdriver-manager

A binary manager for E2E testing
MIT License
225 stars 114 forks source link

Latest chrome is not supported 115.0.5790.98 #523

Open jthacker opened 1 year ago

jthacker commented 1 year ago

Background

As of version 115, chromedriver builds are now stored in a new repository.

Starting with M115 the latest Chrome + ChromeDriver releases per release channel (Stable, Beta, Dev, Canary) are available at the Chrome for Testing availability dashboard. For automated version downloading one can use the convenient JSON endpoints.

Reproducible case

docker run -it node:latest /bin/bash
mkdir /tmp/project && cd /tmp/project
npm install webdriver-manager
npx webdriver-manager update --versions.chrome=115.0.5790.98

Output

npx webdriver-manager update --versions.chrome=115.0.5790.98
webdriver-manager: using local installed version 12.1.9
[00:23:47] I/file_manager - creating folder /tmp/node_modules/webdriver-manager/selenium
[00:23:47] I/config_source - curl -o/tmp/node_modules/webdriver-manager/selenium/standalone-response.xml https://selenium-release.storage.googleapis.com/
[00:23:47] I/config_source - curl -o/tmp/node_modules/webdriver-manager/selenium/chrome-response.xml https://chromedriver.storage.googleapis.com/
[00:23:47] I/config_source - curl -o/tmp/node_modules/webdriver-manager/selenium/gecko-response.json https://api.github.com/repos/mozilla/geckodriver/releases
[00:23:47] E/downloader - options.uri is a required argument
[00:23:47] I/update - chromedriver: file exists /tmp/node_modules/webdriver-manager/selenium/chromedriver_115.0.5790.98.zip
[00:23:47] I/update - chromedriver: unzipping chromedriver_115.0.5790.98.zip
/tmp/node_modules/webdriver-manager/built/lib/cmds/update.js:232
            throw new Error(`Invalid filename: ${path.resolve(outputDir, fileName)}`);
                  ^

Error: Invalid filename: /tmp/node_modules/webdriver-manager/selenium/chromedriver_115.0.5790.98.zip
    at unzip (/tmp/node_modules/webdriver-manager/built/lib/cmds/update.js:232:19)
    at /tmp/node_modules/webdriver-manager/built/lib/cmds/update.js:205:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 1)
StanislavKharchenko commented 1 year ago

@dgp1130 ???

martinharyanto commented 1 year ago

I think this is also the same with my problem, today I tried to run webdriver-manager on my phyton code for selenium, and this error appear

Traceback (most recent call last):
  File "/Users/martinharyanto/PycharmProjects/pythonProject/main.py", line 61, in <module>
    main()
  File "/Users/martinharyanto/PycharmProjects/pythonProject/main.py", line 21, in main
    driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/martinharyanto/PycharmProjects/pythonProject/venv/lib/python3.11/site-packages/webdriver_manager/chrome.py", line 39, in install
    driver_path = self._get_driver_binary_path(self.driver)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/martinharyanto/PycharmProjects/pythonProject/venv/lib/python3.11/site-packages/webdriver_manager/core/manager.py", line 33, in _get_driver_binary_path
    file = self._download_manager.download_file(driver.get_driver_download_url())
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/martinharyanto/PycharmProjects/pythonProject/venv/lib/python3.11/site-packages/webdriver_manager/drivers/chrome.py", line 59, in get_driver_download_url
    modern_version_url = self.get_url_for_version_and_platform(driver_version_to_download, os_type)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/martinharyanto/PycharmProjects/pythonProject/venv/lib/python3.11/site-packages/webdriver_manager/drivers/chrome.py", line 94, in get_url_for_version_and_platform
    raise Exception(f"No such driver version {browser_version} for {platform}")
Exception: No such driver version 115.0.5790.114 for mac-arm64
mdislam04 commented 1 year ago

i am also getting the same issue. is some one looking into it?

$ npx webdriver-manager update --gecko=false --versions.chrome 115.0.5790.102 webdriver-manager: using global installed version 12.1.9 [13:14:29] I/config_source - curl -oC:\Users\mohmmad.islam\AppData\Local\npm-cache_npx\88020e2694c9921b\node_modules\webdriver-manager\selenium\standalone-response.xml https://selenium-release.storage.googleapis.com/ [13:14:29] I/config_source - curl -oC:\Users\mohmmad.islam\AppData\Local\npm-cache_npx\88020e2694c9921b\node_modules\webdriver-manager\selenium\chrome-response.xml https://chromedriver.storage.googleapis.com/ [13:14:30] E/downloader - options.uri is a required argument [13:14:30] I/update - chromedriver: file exists C:\Users\mohmmad.islam\AppData\Local\npm-cache_npx\88020e2694c9921b\node_modules\webdriver-manager\selenium\chromedriver_115.0.5790.102.zip [13:14:30] I/update - chromedriver: unzipping chromedriver_115.0.5790.102.zip C:\Users\m\AppData\Local\npm-cache_npx\88020e2694c9921b\node_modules\webdriver-manager\built\lib\cmds\update.js:232 throw new Error(Invalid filename: ${path.resolve(outputDir, fileName)}); ^

Error: Invalid filename: C:\Users\m\AppData\Local\npm-cache_npx\88020e2694c9921b\node_modules\webdriver-manager\selenium\chromedriver_115.0.5790.102.zip at unzip (C:\Users\m\AppData\Local\npm-cache_npx\88020e2694c9921b\node_modules\webdriver-manager\built\lib\cmds\update.js:232:19) at C:\Users\m\AppData\Local\npm-cache_npx\88020e2694c9921b\node_modules\webdriver-manager\built\lib\cmds\update.js:205:13 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Promise.all (index 1)

Node.js v19.8.1

bboycs commented 1 year ago

chromedrive changed their endpoint for download the latest chromedriver (115 onwards)

StanislavKharchenko commented 1 year ago

use "selenium-manager" to download latest chromedriver binaries.

bboycs commented 1 year ago

@StanislavKharchenko do you have idea how to match the "selenium-manager" with protractor ?

StanislavKharchenko commented 1 year ago

@bboycs The simple solution is to prepare short script which will call selenium-manager, download driver binaries and copy it to node-modules/webdriver-manager/downloads folder (to path where these binaries should actually present)

ParmaJonEman commented 1 year ago

What I did to solve this is just write a postinstall node script to hit the "last-known-good-versions-with-downloads" endpoint , download the correct file, and unzip it. I then added the "chromeDriver" parameter to the protractor config file, so that it points to where I download it, instead of attempting to use webdriver-manager.

i-C-o-d-e-r commented 1 year ago

Inspired by @StanislavKharchenko and @ParmaJonEman proposals, I use this method as a workaround:

  1. Install the NPM package chromedriver as a dev-dependency in package.json
  2. Amend Protractors config file protractor.conf.js by letting chromeDriver point to the Chrome-Driver executable provided by the NPM package. On Windows this is chromeDriver: './node_modules/chromedriver/lib/chromedriver/chromedriver.exe'
karan-deep commented 1 year ago

For Mac and using NPM webdriver-manager package,

  1. Download same version of chrome-driver as per your browser version. https://googlechromelabs.github.io/chrome-for-testing/
  2. Go to cd /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium.
  3. Copy downloaded chrome-driver to this folder.
  4. Rename downloaded chrome-driver version with your latest selenium chrome driver version. Ex -> downloaded chrome-driver to chromedriver_114.0.5735.90.
  5. After renaming, convert it to zip folder as well.
  6. Allow Anyway it from Security & Privacy.

Now, you would be using latest chrome driver for selenium with your latest browser. You would not see following error "session not created: This version of ChromeDriver only supports Chrome version 114 Current browser version is 116.0.5845.110 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome".

Don't run webdriver-manager update cmd after renaming otherwise it will overwrite older version of chrome-driver

barbara commented 1 year ago

@karan-deep I tried this but I still get an error:

Error: SessionNotCreatedError: Unable to create new service: ChromeDriverService
Driver info: driver.version: unknown

Any ideas?

vatan18 commented 3 months ago

@karan-deep @ParmaJonEman I use this method as a workaround by creating a script https://gist.github.com/vatan18/8f92634f178f8036995bc161ed1e75d9

OrangeDog commented 3 months ago

@StanislavKharchenko

use "selenium-manager" to download latest chromedriver binaries.

Not this surely?

Can you be more specific? What should people use instead of npx webdriver-manager update?