Skip to content

Conversation

@iouym
Copy link
Contributor

@iouym iouym commented Jul 24, 2023

This PR adds support for the new Chrome for Testing API's, as a side-effect it resolves issues seen in #253 where versions of Chrome higher than or equal to 115.0.5763.0 would result in a 404 response when attempting to download the required chrome driver. I've also retained backwards compatibility with the older Chrome driver storage API's as older versions currently aren't supported by the Chrome for Testing API's.

This PR also fixes issues with downloading older versions of Chrome driver on ARM64 based machines, previously Chrome driver versions less than or equal to 106.0.5249.21 would fail to download due to the Chrome storage API's using the 64_m1 extension instead of the arm64 extension which has now been adopted since.

@JDCain
Copy link

JDCain commented Jul 25, 2023

Using .Result with HttpClient was causing deadlocks with parallel tests when I tried this code.
I changed it to the following based on https://stackoverflow.com/a/53529122/4540638

private ChromeVersionInfo GetVersionFromChromeForTestingApi(string version)
{
    var task = Task.Run(() => _chromeForTestingClient.GetKnownGoodVersionsWithDownloads());
    task.Wait();
    var knownGoodVersions = task.Result;
    _chromeVersionInfo = knownGoodVersions.Versions.FirstOrDefault(cV => cV.Version == version);

    return _chromeVersionInfo;
}

I also made HttpClient static per https://learn.microsoft.com/en-us/dotnet/fundamentals/networking/http/httpclient-guidelines#recommended-use and I was able to use this successfully with xunit parallel testing selenium.

edit: I think I am running into issues with HttpClient not working with proxy correctly since it's not using the WithProxy settings

@iouym
Copy link
Contributor Author

iouym commented Jul 28, 2023

@JDCain I've applied some of those recommended fixes, thanks for that! :)

As for the WithProxy settings, I'll have to revise how this is built a little to cater for that use case

Copy link
Owner

@rosolko rosolko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, let's merge it.
Thanks a lot!

@rosolko rosolko merged commit b60b3fc into rosolko:master Jul 30, 2023
@iouym iouym deleted the feature/chrome-for-testing-integration branch July 31, 2023 05:54
@kieranedwards
Copy link

Hi all, now that this PR has been merged, when does the updated package get published? Thank you!

@praveenm-symplr
Copy link

Hi all, now that this PR has been merged, when does the updated package get published? Thank you!

It has been released now!
https://github.com/rosolko/WebDriverManager.Net/releases/tag/2.17.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants