[๐ Bug]: WebDriverManager with the "MatchingBrowser" command displays error in Selenium C#
svadivel0006 opened this issue ยท 8 comments
Try using:
new DriverManager().SetUpDriver(new ChromeConfig(), VersionResolveStrategy.MatchingBrowser);
and also make sure that:
there is no previous "chromedriver.exe" file in the bin directory.
I can't even get to that stage.
I'm current on Visual Studio and v4.0.30319 of WebDriverManager
this line of code:
new WebDriverManager.DriverManager().SetUpDriver(new WebDriverManager.DriverConfigs.Impl.ChromeConfig(), VersionResolveStratgey.MatchingBrowser);
is ... unusual.
The ChromeConfig other people use is not 'available' unless I decorate the name that way. The VersionResolveStrategy is not available at all. Where is that defined. I can't even get to the 'Hey this doesn't work phase'
Well yes, now that I look again at the NuGet PM, I see it listed as 2.16.2 which was what I already had installed.
I was looking at the Runtime Version in the Properties window.
But where is VersionResolveStrategy defined?
Where is ChromeConfig() defined for that matter that it has to be thus decorated to compile?
WebDriverManager.DriverConfigs.Impl
OK, so found it in the Helpers section so final command does compile now. Here it is:
new WebDriverManager.DriverManager().SetUpDriver(new WebDriverManager.DriverConfigs.Impl.ChromeConfig(), WebDriverManager.Helpers.VersionResolveStrategy.MatchingBrowser);
Runtime Exception generated was:
Maybe I am missing a 'using' directive.
No solution in this? I got the same error after chrome is updated. Tried with or without VersionResolveStrategy.MatchingBrowser, didnt work both.
code:
new WebDriverManager.DriverManager().SetUpDriver(new ChromeConfig(), VersionResolveStrategy.MatchingBrowser);
driver = new ChromeDriver();
error:
System.InvalidOperationException : session not created: This version of ChromeDriver only supports Chrome version 111
Current browser version is 113.0.5672.64 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
i have the same issue, the main program seems to be that VersionResolveStrategy.MatchingBrowser tries to connect to google api for chrome and download based on your SO + chromeversion
but if that combination doesn't exist on the server it results in an error