Open FredCni opened 3 years ago
Same here, the latest chrome is 89 in linux (after an update) while your webdriver gives a 90+ version.
We had a similar issue with webdriver-manager and puppeteer
[07:02:07] E/launcher - Error: SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 90
Current browser version is 89.0.4389.0 with binary path f:\a\1\s\src\Web\node_modules\puppeteer\.local-chromium\win64-843427\chrome-win\chrome.exe
(Driver info: chromedriver=90.0.4430.24 (),platform=Windows NT 10.0.17763 x86_64)
at Object.checkLegacyResponse (f:\a\1\s\src\Web\node_modules\selenium-webdriver\lib\error.js:546:15)
at parseHttpResponse (f:\a\1\s\src\Web\node_modules\selenium-webdriver\lib\http.js:509:13)
at f:\a\1\s\src\Web\node_modules\selenium-webdriver\lib\http.js:441:30
at processTicksAndRejections (internal/process/task_queues.js:93:5)
and a quick fix is to update puppeteer to latest with
npm puppeteer@latest
Maybe Angular's webdriver-manager
could automatically match the installed version of Chrome instead of assuming the latest version is installed and matches that of ChromeDriver. Or at least provide an opt-in configuration setting to behave this way (to maintain retrocompatibility).
It is possible to automate the detection of the ChromeDriver's version matching the installed version of Chrome by following these steps, although the method to obtain the installed version of Chrome may vary depending on the platform.
yes, it would be nice if webdriver-manager
was automatically matching its version on the installed chrome version.
But here in this case, Chrome v90 for windows has not been released by google, so it's definitively a webdriver-manager
issue.
(it exists for Android though. Don't mix up OS! ;-))
Could someone on webdriver-manager team offer some insight to the mechanism that causes this to happen? Not sure how webdriver-manager ultimately decides which version of Chrome-Driver to install.
Edit: More specifically, what is the mechanism or location that deems a specific version as "latest stable" from webdriver-manager's perspective?
@FredCni
Well, the problem as I understand it is that webdriver-manager
, with the default protractor
configuration, simply installs the latest ChromeDriver version referenced here. It works fine when Chrome is up to date on the computer & the latest ChromeDriver version matches this version of Chrome, which should be true in most cases, but sometimes it fails, like when Google does not release the latest Chrome version simultaneously on all platforms.
If you want the bug to be fixed, you need to improve the default ChromeDriver version selection mechanism. What I proposed above (use the installed Chrome's version and use the ChromeDriver's API to detect the version to download) is just a way to make it fully automated, without the need to maintain a platform-to-ChromeDriver version mapping table on the webdriver-manager
or protractor
's side.
@TylerNielsen
webdriver-manager
does not install Chrome, it installs ChromeDriver, whose version has to match the installed version of Chrome. When no specific version is specified in the update command, it just installs the latest version available from the following API endpoint.
What I suggest is that webdriver-manager
adds an option to install the driver version matching the installed Chrome version instead of just installing the latest or an explicit one. Then, protactor, which uses webdriver-manager
to manage the ChromeDriver installation, could simply have a configuration setting allowing us to use this behavior instead of the "use the latest version" or "use this specific version" ones.
Note that this mechanism could be built in protractor
instead of webdriver-manager
to keep the tool simpler, but if the tool is used by other frameworks, it could prove useful for them too.
@madmox - thank you - "Chrome" was a typo on my side, I meant chromedriver.
I guess the follow-up question is whether anyone knows who or what updates the value returned by that endpoint (https://chromedriver.storage.googleapis.com/LATEST_RELEASE);
I have found this work around, so this issue is only annoying webdriver-manager update --versions.chrome=89.0.4389.23
Trying this workaround but I am still getting the same error about version 90 expected. I tried to run a clean first but it keeps trying to use version 90
I have found this work around, so this issue is only annoying webdriver-manager update --versions.chrome=89.0.4389.23
Trying this workaround but I am still getting the same error about version 90 expected. I tried to run a clean first but it keeps trying to use version 90
Are you using protractor @dshokouhi-lrn? If so, this should get you a fresh install of chromedriver 89:
rm -rf node_modules/protractor/node_modules/webdriver-manager/selenium/chrome* && npx webdriver-manager update --versions.chrome 89.0.4389.23
If you are using protractor installed globally, then change the routes accordingly.
@TylerNielsen There is nothing wrong with this endpoint, it correctly lists the latest ChromeDriver version available. It's just that it doesn't make any sense when running e2e tests to use this endpoint to determine which version of ChromeDriver should be installed, because it does not necessarily matches the current machine's Chrome version (it's true most of the time, but not always).
In the current state of things, in a default Angular 10 project, protractor
simply uses webdriver-manager
to install the latest version of ChromeDriver. You can override this behavior and set an explicit version of ChromeDriver in the protractor config , but I wouldn't recommend that as it would break as soon as Google releases a new Chrome update on your platform.
I think a default Angular project should rather auto-detect the version of ChromeDriver to install based on the installed Chrome version. To make this possible, it would be easier if webdriver-manager
itself had that algorithm implemented and an option to use it:
webdriver-manager update --versions.chrome "90.0.4430.24" ---> installs this explicit ChromeDriver version
webdriver-manager update --versions.chrome "latest" ---> installs the latest ChromeDriver version
webdriver-manager update --versions.chrome "autodetect" ---> installs the ChromeDriver version matching the current machine's Chrome version
Then protractor
would just need to use this option by default instead of "latest".
@madmox are you sure that's true? According to this status page (that I thought was managed by chrome team - though admittedly not positive), although chrome 90 was intended to go out yesterday (4/13), it's still in beta channel as of today (4/14).
If it's truly latest for stable channel, I should be able to update to it by going to Chrome Settings > About, and it doesn't update to 90. Seems this jumped the gun to me.
Update: It should be latest stable chromedriver version, not just latest chromedriver version. Technically you can could have gotten chromedriver 90 much earlier, since Chrome 90 had been in beta for a long time before this issue occurred.
Even in the googleblog, they just posted yesterday that stable for desktop is 89.0.4389.128. Source: https://chromereleases.googleblog.com/
@dshokouhi-lrn Did you run webdriver-manager with the version specified as a parameter?
As in webdriver-manager start --versions.chrome=89.0.4389.23
@TylerNielsen Nope, I'm unsure, that was just pure deduction from the information given above that stated 90.x was out for Android but not for desktop Linux/Windows.
But it looks like the maintainers of the ChromeDriver latest version endpoint have just reverted back to 89.0.4389.23
for the time being. Running e2e tests using the default config should work on most platforms now (well, maybe not for Android since it has Chrome 90.x and the driver is 89.x, but I'm not sure it's possible to run the driver on Android).
Maybe the version of Chrome and ChromeDriver is supposed to be synchronized on all desktop platforms at all times and there was a failure in the process during the past hours, in which case selecting the latest ChromeDriver version should always be the right choice as long as your Chrome install is up to date (and you are running a desktop OS).
@madmox - glad to see that got reverted.
Either way, I still think the suggestion to actually check what version of chrome is used locally is the most reliable, just want to understand how this issue can happen to decide if this is just an "oopsie" that happens every so often (at least a couple times in past year) or something more problematic.
Yep, you are absolutely right. It just might make this less of a priority, even though it broke our CI pipeline for a few hours.
I have found this work around, so this issue is only annoying webdriver-manager update --versions.chrome=89.0.4389.23
Trying this workaround but I am still getting the same error about version 90 expected. I tried to run a clean first but it keeps trying to use version 90
Are you using protractor @dshokouhi-lrn? If so, this should get you a fresh install of node modules including chromedriver 89:
rm -rf node_modules/protractor/node_modules/webdriver-manager/selenium/chrome* && npx webdriver-manager update --versions.chrome 89.0.4389.23
If you are using protractor installed globally, then change the routes accordingly.
@dshokouhi-lrn Did you run webdriver-manager with the version specified as a parameter? As in
webdriver-manager start --versions.chrome=89.0.4389.23
I was able to get up and running, thank you guys for the help!! My issue was that I did not properly clear out the old files :)
@TylerNielsen There is nothing wrong with this endpoint, it correctly lists the latest ChromeDriver version available. It's just that it doesn't make any sense when running e2e tests to use this endpoint to determine which version of ChromeDriver should be installed, because it does not necessarily matches the current machine's Chrome version (it's true most of the time, but not always).
In the current state of things, in a default Angular 10 project,
protractor
simply useswebdriver-manager
to install the latest version of ChromeDriver. You can override this behavior and set an explicit version of ChromeDriver in the protractor config , but I wouldn't recommend that as it would break as soon as Google releases a new Chrome update on your platform.I think a default Angular project should rather auto-detect the version of ChromeDriver to install based on the installed Chrome version. To make this possible, it would be easier if
webdriver-manager
itself had that algorithm implemented and an option to use it:webdriver-manager update --versions.chrome "90.0.4430.24" ---> installs this explicit ChromeDriver version webdriver-manager update --versions.chrome "latest" ---> installs the latest ChromeDriver version webdriver-manager update --versions.chrome "autodetect" ---> installs the ChromeDriver version matching the current machine's Chrome version
Then
protractor
would just need to use this option by default instead of "latest".
These are really great ideas. I wish I thought of this.
@cnishina - while I think everyone agrees there is an even better alternative, unfortunately there IS sometimes a problem with that endpoint, as evidenced by this thread. The endpoint was returning a version of ChromeDriver that was for a non-stable version of Chrome. The endpoint doesn't return the later overall version of ChromeDriver, but rather the latest version of Chromedriver that supports chrome version that's in stable release. Most of the time it works just that way, but in the case that prompted this thread and issues for many organizations, it was temporarily ahead of chrome, and then was reverted back to the supported version.
Am I wrong in thinking that this project is largely unmaintained, especially since the Angular team has decided to drop Protractor support next year? I just want to run my tests in a predictable environment, without writing a ton of tooling myself.
I'm managing the Chromium install using puppeteer
, which does a good job of installing a current, platform-appropriate binary, and giving Protractor and/or Karma a handle on it. This works well.
Where it falls apart is that webdriver-manager update
never wants to install the matching webdriver version. The index file doesn't host matching patchlevels for the Chromium versions distributed by Puppeteer, so I'm stuck going out and finding something "close enough" by hand, and plugging it in to versions.chrome
on the command line. I'd love to be able to tell webdriver-manager
to look for "90.0" or "LATEST_RELEASE_90".
Expected behaviour: Should not update to v90 if Chrome is v89. This already happened in the past so I suggest you review the way compatibility issues are addressed.
I have found this work around, so this issue is only annoying webdriver-manager update --versions.chrome=89.0.4389.23