Skip to content

WebDriverManager for .Net - DriverManager + VersionResolveStrategy.MatchingBrowser throws a System.IO.FileNotFoundException #315

@belugui

Description

@belugui

Hello, I will start by saying that I have used DriverManager for .Net for quite sometime and it has worked Ok for me while executing tests in my local and over SelfHosted or OnPrem VMs where I have control of the Chrome Browser version installed, but nowadays that I am planning to execute tests over Azure Hosted machines is that I require to take advantage of something like the "VersionResolveStrategy.MatchingBrowser" option to pull the right Chrome Driver version (sometimes that one may not be the latest one) to match the Chrome Browser version from the Microsoft's windows-latest image.

In theory, "VersionResolveStrategy.MatchingBrowser" will solve this for me, except that it is throwing a system exception.

Below lines I have tested separatelly with positive results:
new DriverManager().SetUpDriver(new ChromeConfig());
new DriverManager().SetUpDriver(new ChromeConfig(), "Latest");
new DriverManager().SetUpDriver(new ChromeConfig(), "122.0.6261.57");

This is the line that when executed, throws the exception:
new DriverManager().SetUpDriver(new ChromeConfig(), VersionResolveStrategy.MatchingBrowser);

Here you have the Stack Trace:

Message: 
System.IO.FileNotFoundException : C:\Users\xxxxx\AppData\Local\Chromium\Application\chrome.exe

Stack Trace: 
FileVersionInfo.GetVersionInfo(String fileName)
RegistryHelper.GetInstalledBrowserVersionWin(String executableFileName)
ChromeConfig.GetRawBrowserVersion()
ChromeConfig.GetMatchingBrowserVersion()
DriverManager.GetVersionToDownload(IDriverConfig config, String version)
DriverManager.SetUpDriver(IDriverConfig config, String version, Architecture architecture)

Chrome Browser version installed on my local is: 122.0.6261.58
WebDriverManager version in the project is: 2.17.2

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions