-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[🐛 Bug]: WebDriverManager.Net not working with new chromedriver endpoints for Chrome since version 115 #253
Comments
Hi folks, do we have a time frame for this issue? Just seeing this today also and wondering if there is a work around? |
FYI there is also issue for that in selenium 4 'buil-in' driver manager |
Some context around this issue. The ChromeDriver team has changed the chromedriver download location for any Chrome version >114 |
We moved to selenium 4 'built-in' driver manager. It also have some issues in our test runs, but we fixed it on our side |
Thanks @IvanQL - I'll take a look at that this morning, thanks for your post. Kind regards 👍 |
We have the same issue. Alot of our automated systems are failing due to this. We upgraded to latest webdriver manager and selenium but both have the same issue. It seems selenium is not going to update to handle this and instead waiting for the chrome team to release the drivers on the current site? |
Ditto - our automated scripts are starting to fail re: Chrome 115. Any approximate timescale to fix would be appreciated - many thanks. |
We temporarily patched our systems by adding an override for the public partial class ChromeConfigOverride : ChromeConfig
{
private const string BaseVersionPatternUrl = "https://chromedriver.storage.googleapis.com/<version>/";
private const string LatestReleaseVersionUrl = "https://chromedriver.storage.googleapis.com/LATEST_RELEASE";
private const string ExactReleaseVersionPatternUrl =
"https://chromedriver.storage.googleapis.com/LATEST_RELEASE_<version>";
public virtual string GetName()
{
return "Chrome";
}
public virtual string GetUrl32()
{
return GetUrl();
}
public virtual string GetUrl64()
{
return GetUrl();
}
private string GetUrl()
{
#if NETSTANDARD
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
var architectureExtension =
RuntimeInformation.ProcessArchitecture == System.Runtime.InteropServices.Architecture.Arm64
? "_arm64"
: "64";
return $"{BaseVersionPatternUrl}chromedriver_mac{architectureExtension}.zip";
}
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
return $"{BaseVersionPatternUrl}chromedriver_linux64.zip";
}
#endif
return $"{BaseVersionPatternUrl}chromedriver_win32.zip";
}
public virtual string GetBinaryName()
{
#if NETSTANDARD
var isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
#else
var isWindows = true;
#endif
var suffix = isWindows ? ".exe" : string.Empty;
return $"chromedriver{suffix}";
}
public virtual string GetLatestVersion()
{
return GetLatestVersion(LatestReleaseVersionUrl);
}
private static string GetLatestVersion(string url)
{
var uri = new Uri(url);
var webRequest = WebRequest.Create(uri);
using (var response = webRequest.GetResponse())
{
using (var content = response.GetResponseStream())
{
if (content == null) throw new ArgumentNullException($"Can't get content from URL: {uri}");
using (var reader = new StreamReader(content))
{
var version = reader.ReadToEnd().Trim();
return version;
}
}
}
}
public virtual string GetMatchingBrowserVersion()
{
var rawChromeBrowserVersion = GetRawBrowserVersion();
if (string.IsNullOrEmpty(rawChromeBrowserVersion))
{
throw new Exception("Not able to get chrome version or not installed");
}
var chromeBrowserVersion = VersionHelper.GetVersionWithoutRevision(rawChromeBrowserVersion);
var url = ExactReleaseVersionPatternUrl.Replace("<version>", chromeBrowserVersion);
Version chromeVersion = new Version(chromeBrowserVersion);
if (chromeVersion >= new Version(115, 0, 0))
{
url = ExactReleaseVersionPatternUrl.Replace("<version>", @"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/<version>/win32/chromedriver-win32.zip");
}
return GetLatestVersion(url);
}
private string GetRawBrowserVersion()
{
#if NETSTANDARD
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
return RegistryHelper.GetInstalledBrowserVersionOsx("Google Chrome", "--version");
}
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
return RegistryHelper.GetInstalledBrowserVersionLinux(
"google-chrome", "--product-version",
"chromium", "--version",
"chromium-browser", "--version");
}
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return RegistryHelper.GetInstalledBrowserVersionWin("chrome.exe");
}
throw new PlatformNotSupportedException("Your operating system is not supported");
#else
return RegistryHelper.GetInstalledBrowserVersionWin("chrome.exe");
#endif
}
} |
Sửa lỗi không tự động đăng video được (lần 4): WebDriverManager.Net not working with new chromedriver endpoints for Chrome since version 115 rosolko/WebDriverManager.Net#253 Signed-off-by: RauCu <[email protected]>
Thanks for providing the above. However, this line is returning a 404 error url = ExactReleaseVersionPatternUrl.Replace("", @"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing//win32/chromedriver-win32.zip"); |
@MuteMO You are missing the chrome version in the URL you generated. It should be like this |
I am afraid I am still getting the error when this is called from the code. |
If you debug and console log the URL that has been generated, then paste it here please? |
OK its failing at this line of code: new WebDriverManager.DriverManager().SetUpDriver(new ChromeConfigOverride(), VersionResolveStrategy.MatchingBrowser) but its not returning any url just a 404 error on MatchingBrowser would I need to change this 'VersionResolveStrategy.MatchingBrowser' based on the new changes or should your code in the Override class take care of it. If so what am I missing please? |
If you can (temporarily) live with the latest chrome version, just change the ResolveStrategy to 'Latest'. Then it will works fine. return new WebDriver
{
BrowserName = Browsers.Chrome,
Driver = new ChromeDriver(
Path.GetDirectoryName(new DriverManager().SetUpDriver(new ChromeConfig(),
VersionResolveStrategy.Latest)), // <= no problem with 'Latest'
options)
}; |
[https://chromedriver.storage.googleapis.com/LATEST_RELEASE_115.0.5790] Which returns NoSuchKey
The specified key does not exist.
No such object: chromedriver/LATEST_RELEASE_115.0.5790
This is due to the changes that Google annoucned in May that would take effect with the 115 release and includes
Here are the new end points |
No need to use WebDriverManager var options = new ChromeOptions(); var driver = new ChromeDriver(service, options); |
Hey everyone, this issue should get resolved once a version is released containing #254 |
Is this supposed to be downloading driver version |
Any ETA on that ? |
|
@ms6073 I was referring to the implementation of WithProxy + ChromeForTestingClient |
Hi folks, sorry to be pain. I'm seeing "The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch" when trying to run |
hi , I am able to resolve the issue ["The remote server returned an error: (404) Not Found."] after updating WebdriverManager to 2.17. Thanks for that. But still I am getting the same issue for Firefox . Is there any solution for that as well ? Thanks in advance, |
Hi, I am able to resolve the issue ["The remote server returned an error: (404) Not Found."] as well after updating to 2.17. |
@smutekgmc Can you try " new DriverManager().SetUpDriver(new FirefoxConfig(), VersionResolveStrategy.MatchingBrowser); " ? |
I suspect that @smutekgmc may have a use case that requires a specific driver version. |
Hi together We have upgraded to version 2.17.0. Now we get an
System.AggregateException : One or more errors occurred. (One or more errors occurred. (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (googlechromelabs.github.io:443))) at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) We also use the |
Probably, in the method If we set the default proxy of public DriverManager WithProxy(IWebProxy proxy)
{
_binaryService = new BinaryService
{
Proxy = proxy
};
WebRequest.DefaultWebProxy = proxy;
// add this line here?
HttpClient.DefaultProxy = proxy;
return this;
} |
another option is to add a Proxy variable, same manner as in BinaryService This way, it will work at least by getting the system proxy before calling the DriverManager @niklausburren would you like to open a PR on this? |
@inflextion I have added a pull request now: #259 |
@ms6073 |
You might want to update your unit test for ChromeConfigs as I think you will find it fails when comparing the min version for google for testing api (note I am using FluentAssertions in the code below). `public void GetLatestVersionTest()
Assert. [TestMethod]
} ` The logic in line 94 of ChromeConfigs.cs that compares versions is not working as expected. It might be better to use the ICOmparer between the two versions instead. `var matchedVersion = new Version(rawChromeBrowserVersion); switch (matchedVersion.CompareTo(MinChromeForTestingDriverVersion)) |
Also noticed that in the GetUrl method of the ChromeConfig.cs class, when _chromeVersionInfo has a value, then the GetUrlFromChromeForTestingApi method is called. The problem is that if we are using the VersionResolveStrategy.MatchingBrowser arg when calling SetUpDriver and the user's browser is newer than the minimum browser version for the new Chrome For Testing APIs, then the code will try to get the version from goolge storage instead of the new location because while the value of _chromeVersion is not set when using this VersionResolveStrategy.
|
This worked like a charm for 115 but my chrome upgraded to 116 now. I get another issue This version of ChromeDriver only supports Chrome version 114 new WebDriverManager.DriverManager().SetUpDriver(new ChromeConfig(), VersionResolveStrategy.Latest) - I tried MatchingBrowser and getting 404 for that. Anyone tried with 116? |
|
Ah thanks, it was my bad. Upgraded to 2.17.1 and it works now. Thanks again |
I use 2.17.1 and has the same problem after Chrome updated to 116. It works correctly before (115). |
Got problems with version 116 |
Facing issues with 2.17.1 & Chrome 116. Works fine with Selenium 4.10.0 but fails after upgrade to 4.11.0. Sharing the logs below.
|
This workaround may help others so posting here
|
That is not an error from WebDriverManager, but an error thrown by OpenQA's Selenium Manager code. |
Yes @ms6073 .issue raised with Selenium team #SeleniumHQ/selenium#12675 |
Problem
After updatating Chrome to version 115 the code below:
finishes with error:
Looks like there are changes for downloading chromedriver since v115
https://chromedriver.chromium.org/downloads
"If you are using Chrome version 115 or newer, please consult the Chrome for Testing availability dashboard. This page provides convenient JSON endpoints for specific ChromeDriver version downloading."
The text was updated successfully, but these errors were encountered: