0

Holla,
so I've been trying to create a web bot with selenium in c# and I'm trying to write a basic Hello World.
Problem is that the thing won't even start up , I've tried everything. trace :

Starting ChromeDriver 97.0.4692.36 (747e0a0f19c13ca6ee136200f5b097448ae4892f-refs/branch-heads/4692@{#607}) on port 61335
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.

DevTools listening on ws://127.0.0.1:61338/devtools/browser/1e6f93d0-b818-4805-b7e3-2c2b9c5ebf71
Unhandled exception. System.InvalidOperationException: session not created: This version of ChromeDriver only supports Chrome version 97
Current browser version is 96.0.4664.110 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe (SessionNotCreated)
   at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse)
   at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.WebDriver.StartSession(ICapabilities desiredCapabilities)
   at OpenQA.Selenium.WebDriver..ctor(ICommandExecutor executor, ICapabilities capabilities)
   at OpenQA.Selenium.Chromium.ChromiumDriver..ctor(ChromiumDriverService service, ChromiumOptions options, TimeSpan commandTimeout)
   at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
   at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeOptions options)
   at OpenQA.Selenium.Chrome.ChromeDriver..ctor()

I'm using JetBrains Rider and Installed Selenium through the NuGet Package Manager , this also downloaded the ChromeWebDriver.exe in the assembly path, just to be sure i deleted it and downloaded the chromewebdriver.exe from here.

I've searched everywhere but the only examples that i find are python ones.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Ledrake
  • 114
  • 10
  • I believe the error is pretty clear.. downgrade the chromedriver to version 96 by downloading it manually at: https://chromedriver.chromium.org/downloads – Nic Laforge Jan 02 '22 at 04:07
  • To ease the process you may also use something like: https://github.com/rosolko/WebDriverManager.Net which will manage the versioning between chrome and chromedriver – Nic Laforge Jan 02 '22 at 04:09
  • Am i missing something , but how is this error clear??????? It says ```This version of ChromeDriver only supports Chrome version 97``` and ```Current browser version is 96.0.4664.110 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe```. From that i understand the Selenium accepts version 97 and i have 96 , but you suggest it is the other way around – Ledrake Jan 02 '22 at 04:20
  • The ChromeDriver is v97 and only supports Chrome version 97. But it is not released yet. ChromeDriver v96 will support your Chrome v96. Both version must match. Hope this helps. When I said "pretty clear", I just meant that 3rd lib error are most of the time very cumbersome compare to this one.. – Nic Laforge Jan 02 '22 at 04:23

1 Answers1

0

This error message...

Unhandled exception. System.InvalidOperationException: session not created: This version of ChromeDriver only supports Chrome version 97

...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.


Your main issue is the incompatibility between the version of the binaries you are using as follows:

Supports Chrome version 97

  • Presumably you are using the latest chrome=96.0.4664.110
  • Release Notes of ChromeDriver v96.0 clearly mentions the following :

Supports Chrome version 96

So there is a clear mismatch between chromedriver=97.0.4692.36 and the chrome=96.0.4664.110


Solution

Ensure that:

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352