Open jthacker opened 1 year ago
@dgp1130 ???
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
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
chromedrive changed their endpoint for download the latest chromedriver (115 onwards)
use "selenium-manager" to download latest chromedriver binaries.
@StanislavKharchenko do you have idea how to match the "selenium-manager" with protractor ?
@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)
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.
Inspired by @StanislavKharchenko and @ParmaJonEman proposals, I use this method as a workaround:
chromedriver
as a dev-dependency in package.jsonprotractor.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'
For Mac and using NPM webdriver-manager package,
cd /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium
.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
@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?
@karan-deep @ParmaJonEman I use this method as a workaround by creating a script https://gist.github.com/vatan18/8f92634f178f8036995bc161ed1e75d9
@StanislavKharchenko
use "selenium-manager" to download latest chromedriver binaries.
Can you be more specific? What should people use instead of npx webdriver-manager update
?
Background
As of version 115, chromedriver builds are now stored in a new repository.
Reproducible case
Output