Error running selenium tests - ChromeDriver only supports Chrome version 79

858 views
Skip to first unread message

Craig W

unread,
Apr 12, 2020, 2:29:25 PM4/12/20
to Selenium Users
I am trying to setup selenium testing on my .net framework 4.7.2 web application. I installed the Selenium.WebDriver - version 3.141.0 and Selenium.WebDriver.ChromeDriver - version 81.0.4044.6900 nuget packages (both the latest stable versions). Although I get the following error when I try to run a Selenium MSTest method:

Initialization method BookingSystem.Tests.SeleniumChrome.TestInit threw exception. System.InvalidOperationException: session not created: This version of ChromeDriver only supports Chrome version 79 (SessionNotCreated).
   
TestCleanup method BookingSystem.Tests.SeleniumChrome.TestClean threw exception. System.NullReferenceException: System.NullReferenceException: Object reference not set to an instance of an object..


So the newest version of Selenium WebDriver does not support the newest version of Chrome browser? My current Chrome version running on my computer is 81.0.4044.92. How can I fix this? I cannot download Chrome browser version 79 because Chrome doesn't allow installation of older versions

Any help would be appreciated.
selenium.png
seleniumerr.PNG

Joe Ward

unread,
Apr 12, 2020, 5:15:49 PM4/12/20
to seleniu...@googlegroups.com
Certainly.

Install-Package Selenium.WebDriver.ChromeDriver -Version 81.0.4044.6900-beta

Though you should note that this version of Chromedriver is in beta (hence the name).

Thanks,

Joseph.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/dd224cba-d858-48a1-af9c-92c689e2ffad%40googlegroups.com.

Craig W

unread,
Apr 12, 2020, 5:55:47 PM4/12/20
to Selenium Users
Thanks a lot for the reply Joseph. I have downloaded the updated version of ChromeDriver - 81.0.4044.6900-beta, although I am still getting this same error: "This version of ChromeDriver only supports Chrome version 79 (SessionNotCreated)."

Do you know why this could be happening?

My project is definitely targeting ChromeDriver 81.0.4044.6900-beta as you can see below:

<packages>
  <package id="MSTest.TestAdapter" version="1.3.2" targetFramework="net472" />
  <package id="MSTest.TestFramework" version="1.3.2" targetFramework="net472" />
  <package id="Selenium.Support" version="3.141.0" targetFramework="net472" />
  <package id="Selenium.WebDriver" version="3.141.0" targetFramework="net472" />
  <package id="Selenium.WebDriver.ChromeDriver" version="81.0.4044.6900" targetFramework="net472" />
</packages>

Here is my selenium test if it makes a difference:

Enter code here...namespace BookingSystem.Tests
{
    [TestClass]
    public class SeleniumChrome
    {
        private static TestContext testContext;
        private RemoteWebDriver driver;

        [ClassInitialize]
        public static void Initialize(TestContext testContext)
        {
            SeleniumChrome.testContext = testContext;
        }

        [TestInitialize]
        public void TestInit()
        {
            driver = GetChromeDriver();
            driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(300);
        }

        [TestCleanup]
        public void TestClean()
        {
            driver.Quit();
        }



        [TestMethod]
        public void FunctionalTestNormal()
        {
            var webAppUrl = "http://csinc-dev.eu-west-1.elasticbeanstalk.com/";
            try
            {
                webAppUrl = testContext.Properties["webAppUrl"].ToString();
            }
            catch (Exception)
            {
                webAppUrl = "http://csinc-dev.eu-west-1.elasticbeanstalk.com/";
            }
            //var webAppUrl = testContext.Properties["webAppUrl"].ToString();

            var startTimestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
            var endTimestamp = startTimestamp + 60 * 10;

            string expectedValue = "Thank you for your booking";

            driver.Navigate().GoToUrl("http://csinc-dev.eu-west-1.elasticbeanstalk.com/");
            driver.Manage().Window.Size = new System.Drawing.Size(1936, 1056);
            driver.FindElement(By.Id("txtRoll")).Click();
            driver.FindElement(By.LinkText("Click if organisation without school roll number")).Click();
            driver.FindElement(By.Id("txtName")).Click();
            driver.FindElement(By.Id("txtName")).SendKeys("Test Organisation");
            driver.FindElement(By.Id("txtDate")).Click();
            driver.FindElement(By.LinkText("16")).Click();
            driver.FindElement(By.CssSelector(".submit")).Click();
            driver.FindElement(By.Id("txtTeacherName")).Click();
            driver.FindElement(By.Id("txtTeacherName")).SendKeys("Mr Smith");
            driver.FindElement(By.Id("txtEmail")).Click();
            driver.FindElement(By.Id("txtEmail")).SendKeys("mrs...@test.com");
            driver.FindElement(By.Id("txtPhoneNumber")).Click();
            driver.FindElement(By.Id("txtPhoneNumber")).SendKeys("014598634");
            driver.FindElement(By.Id("txtAddress1")).Click();
            driver.FindElement(By.Id("txtAddress1")).SendKeys("29 Emmet Lodge");
            driver.FindElement(By.Id("txtAddress2")).SendKeys("Templeogue");
            driver.FindElement(By.Id("txtCounty")).Click();
            driver.FindElement(By.Id("txtCounty")).SendKeys("Dublin 6");
            driver.FindElement(By.Id("txtEircode")).Click();
            driver.FindElement(By.Id("txtEircode")).SendKeys("D6WP38");
            driver.FindElement(By.Id("txtStartTime")).Click();
            driver.FindElement(By.Id("txtStartTime")).SendKeys("10:00");
            driver.FindElement(By.Id("txtEndTime")).Click();
            driver.FindElement(By.Id("txtEndTime")).SendKeys("13:30");
            driver.FindElement(By.Id("txtClassGroups")).Click();
            driver.FindElement(By.Id("txtClassGroups")).SendKeys("4th year students");
            driver.FindElement(By.Id("txtTopics")).Click();
            driver.FindElement(By.Id("txtTopics")).SendKeys("General");
            driver.FindElement(By.Id("surveyBox")).Click();
            driver.FindElement(By.CssSelector(".btn-primary")).Click();
            driver.FindElement(By.CssSelector("h3")).Click();

            string actualValue = driver.FindElement(By.Id("h3")).Text;

            Assert.AreEqual(expectedValue, actualValue);

        }

        private RemoteWebDriver GetChromeDriver()
        {
            var path = Environment.GetEnvironmentVariable("ChromeWebDriver");
            var options = new ChromeOptions();
            options.AddArguments("--no-sandbox");
            //options.AddArgument("headless");

            if (!string.IsNullOrWhiteSpace(path))
            {
                return new ChromeDriver(path, options, TimeSpan.FromSeconds(300));
            }
            else
            {
                return new ChromeDriver(options);
            }
        }
    }
}





On Sunday, April 12, 2020 at 10:15:49 PM UTC+1, That Guy wrote:
Certainly.

Install-Package Selenium.WebDriver.ChromeDriver -Version 81.0.4044.6900-beta

Though you should note that this version of Chromedriver is in beta (hence the name).

Thanks,

Joseph.

On Sun, 12 Apr 2020 at 19:29, Craig W <craigw...@gmail.com> wrote:
I am trying to setup selenium testing on my .net framework 4.7.2 web application. I installed the Selenium.WebDriver - version 3.141.0 and Selenium.WebDriver.ChromeDriver - version 81.0.4044.6900 nuget packages (both the latest stable versions). Although I get the following error when I try to run a Selenium MSTest method:

Initialization method BookingSystem.Tests.SeleniumChrome.TestInit threw exception. System.InvalidOperationException: session not created: This version of ChromeDriver only supports Chrome version 79 (SessionNotCreated).
   
TestCleanup method BookingSystem.Tests.SeleniumChrome.TestClean threw exception. System.NullReferenceException: System.NullReferenceException: Object reference not set to an instance of an object..


So the newest version of Selenium WebDriver does not support the newest version of Chrome browser? My current Chrome version running on my computer is 81.0.4044.92. How can I fix this? I cannot download Chrome browser version 79 because Chrome doesn't allow installation of older versions

Any help would be appreciated.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seleniu...@googlegroups.com.
Message has been deleted

Craig W

unread,
Apr 12, 2020, 6:15:19 PM4/12/20
to Selenium Users

selerr.PNG

Maybe there is something in my code that is calling Chrome version 79? Because my project is definitely targeting ChromeDriver 81.0.4044.6900-beta as you can see from the picture attached

Josh Abrahamsen

unread,
Apr 12, 2020, 8:49:05 PM4/12/20
to Selenium Users
Install the chromedriver nuget package on the tests project you have. I'm guessing you have a different chrome instance that lives in the bin/debug of that project. I ran into the same thing many months ago.
Reply all
Reply to author
Forward
0 new messages