WebDriverManager.Net icon indicating copy to clipboard operation
WebDriverManager.Net copied to clipboard

[🐛 Bug]: WebDriverManager with the "MatchingBrowser" command displays error in Selenium C#

Open svadivel0006 opened this issue 2 years ago • 1 comments

When the WebDriverManager is instantiated with the "MatchingBrowser" command, the browser is not launched and error is displayed

Screenshot:

image

svadivel0006 avatar Jul 17 '22 11:07 svadivel0006

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.

renatosc avatar Sep 08 '22 19:09 renatosc

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'

series0 avatar Dec 13 '22 23:12 series0

@series0 Latest webdrivermanager has 2.16.2 version not 4.0.30319

rosolko avatar Dec 14 '22 06:12 rosolko

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?

series0 avatar Dec 14 '22 16:12 series0

WebDriverManager.DriverConfigs.Impl

rosolko avatar Dec 14 '22 16:12 rosolko

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: image

Maybe I am missing a 'using' directive.

series0 avatar Dec 14 '22 18:12 series0

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

brkacar avatar May 03 '23 09:05 brkacar

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

PwccaCode avatar May 03 '23 16:05 PwccaCode