'Using correct ChromeDriver.exe but still getting driver version error message

so the issue I'm having is when I try to run my automation tests with the Chrome Web browser, I get the following error message:

System.InvalidOperationException
  HResult=0x80131509
  Message=session not created: This version of ChromeDriver only supports Chrome version 80
  (Driver info: chromedriver=80.0.3987.106 (f68069574609230cf9b635cd784cfb1bf81bb53a-refs/branch-heads/3987@{#882}),platform=Windows NT 10.0.17763 x86_64) (InsecureCertificate)
  Source=WebDriver
  StackTrace:
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
   at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options)
   at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service)
   at Gov.Baaqmd.Tests.SeleniumUITests.SeleniumUITests.InitializeWebDriver() in D:\NPS\Tests ProductionSystem WebUI\SeleniumUITests\Framework\SeleniumUITests.cs:line 250
   at Gov.Baaqmd.Tests.SeleniumUITests.SeleniumUITests.TestInitialize() in D:\NPS\Tests ProductionSystem WebUI\SeleniumUITests\Framework\SeleniumUITests.cs:line 168

After the first time I got this error message, I went to Chromium.org page and looked through their directory for the correct chromedriver version that was specified in the error message above, downloaded it and replaced it with the existing chrome driver I had. Once that was done, I tried running my automation script again, but got the same exact error message and I'm at a loss as to what to do next.

  • My Selenium.Support nuget package = v3.9.1
  • My Selenium.WebDriver nuget package = V3.9.1
  • My current version of my Google Chrome web browser = Version 83.0.4103.106 (Official Build) (64-bit)

I do find it weird that the chromedrivers from the website are Win32 bit versions, I don't know if that's part of the issue.



Solution 1:[1]

The chrome version should match with your chromedriver.exe, if you want to update along with the chrome browser version use WebDriverManager This will update your chromedriver everytime you run the tests. Else download it manually , but the versions needs to be compatible and workable.

Solution 2:[2]

Figure out how does your test framework obtains chromedriver. Cases I had dealt with:

  1. Framework runs the chromedriver that is installed on the machine in advance - if you're on Windows, go check PATH env variable to make sure that there's no path to some old driver you've forgotten about

  2. Framework downloads the chromedriver according to the version that is set in the configs - you just need to adjust the configs and set compatible version

Solution 3:[3]

https://chromedriver.chromium.org Check above link , you should use right chrome driver exe file according to your chrome browser version

Solution 4:[4]

The Selenium error messaging is poor, and remains so (2 years after this question was posted). When they say "This version of ChromeDriver only supports Chrome version X", they mean the major versions must match exactly. Chrome cannot be newer than ChromeDiver, and ChromeDriver cannot be newer than Chrome. You can solve by upgrading one or downgrading the other.

Solution 5:[5]

Check if the chrome driver is in C: drive or in some other drive location, I got the same issue. But when i stored the chromedriver in C drive and given location from there it's working.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 SeleniumBeginner
Solution 2 Alex Pahom
Solution 3 Justin Lambert
Solution 4 maurice
Solution 5 Sushem