'Unable to receive message from renderer - C# - Selenium

Sorry for another newbie question I have searched google and cannot find my answer. After working with Javascript for a couple of weeks I have managed to convince work to do a C# proof of concept for selenium. This morning I have started this (I know virtually nothing about C#). I have the latest drivers/web browsers/selenium installed.

When I execute the code below I get this in the log. Chrome opens and shuts immediately. I am obviously doing something wrong?

----- Discover test started ------
NUnit Adapter 3.8.0.0: Test discovery starting
NUnit Adapter 3.8.0.0: Test discovery complete
========== Discover test finished: 1 found (0:00:00.18) ==========
------ Run test started ------
NUnit Adapter 3.8.0.0: Test execution started
Running all tests in C:\Users\snejad\Documents\Visual Studio 2017\Projects\ClassLibrary1\ClassLibrary1\bin\Debug\ClassLibrary1.dll
NUnit3TestExecutor converted 1 of 1 NUnit test cases
SetUp failed for test fixture ProofOfConcept.HomePageTest
System.InvalidOperationException : session not created exception
from disconnected: Unable to receive message from renderer
  (Session info: chrome=60.0.3112.78)
  (Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Windows NT 6.1.7601 SP1 x86_64) (InsecureCertificate)
   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(ChromeOptions options)
   at OpenQA.Selenium.Chrome.ChromeDriver..ctor()
   at ProofOfConcept.HomePageTest..ctor() in C:\Users\snejad\Documents\Visual Studio 2017\Projects\ClassLibrary1\ClassLibrary1\HomePageTest.cs:line 15
NUnit Adapter 3.8.0.0: Test execution complete
========== Run test finished: 1 run (0:00:02.561) ==========

    enter code here



*****************************************************************************

using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Firefox;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProofOfConcept
{
    public class HomePageTest
    {
        IWebDriver driver = new ChromeDriver();

        [Test]
        public void myFirstTest()
        {
            driver.Navigate().GoToUrl("https://www.google.co.uk");

            Assert.AreEqual("Google", driver.Title);

            driver.Close();

            driver.Quit();
        }
    }
}

Firefox error

------ Discover test started ------ NUnit Adapter 3.8.0.0: Test discovery starting NUnit Adapter 3.8.0.0: Test discovery complete ========== Discover test finished: 1 found (0:00:00.173) ========== ------ Run test started ------ NUnit Adapter 3.8.0.0: Test execution started Running all tests in C:\Users\snejad\Documents\Visual Studio 2017\Projects\ClassLibrary1\ClassLibrary1\bin\Debug\ClassLibrary1.dll NUnit3TestExecutor converted 1 of 1 NUnit test cases SetUp failed for test fixture ProofOfConcept.HomePageTest OpenQA.Selenium.WebDriverException : Unable to find a matching set of capabilities 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.Firefox.FirefoxDriver..ctor(FirefoxOptions options) at OpenQA.Selenium.Firefox.FirefoxDriver..ctor() at ProofOfConcept.HomePageTest..ctor() in C:\Users\snejad\Documents\Visual Studio 2017\Projects\ClassLibrary1\ClassLibrary1\HomePageTest.cs:line 15 NUnit Adapter 3.8.0.0: Test execution complete ========== Run test finished: 1 run (0:00:01.6884) ==========



Solution 1:[1]

We experienced a similar issue to yours.

We discovered that the Chrome browser and chromedriver need to be at precisely the same version.

In our case, once we installed chromedriver and Chrome browser both at version 99.0.4844.51, our problem went away.

I note from your logs you have:

  • chrome=60.0.3112.78
  • chromedriver=2.31.488763

which are at significantly different versions.

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 Artie Leech