1

I'm trying to run Selenium in C#, but I get the following error:

DevTools listening on ws://127.0.0.1:52646/devtools/browser/0bd3a117-cf36-4bd9-9614-31ae610fc7c5
[1575911008.197][WARNING]: Timed out connecting to Chrome, retrying...

To be sure, I have installed Chromedriver version 78 and Chrome version 78. There was the possibilty that the versions were incompatible, so I installed Chromedriver version 79 and placed in the same directory. Then I got a this error:

Unhandled exception. System.InvalidOperationException: session not created: This version of ChromeDriver only supports Chrome version 79 (SessionNotCreated) 

After this check I knew for sure that the versions were the same(I have used selenium in the past). The chrome browser is opening, but it stays blank. When I try to navigate to a url, nothing happens.

I have read this post but no success.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.0</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Selenium.WebDriver" Version="3.141.0"/>
    <PackageReference Include="NUnit" Version="3.12.0"/>
    <PackageReference Include="NUnit3TestAdapter" Version="3.15.1"/>
  </ItemGroup>
</Project>
namespace Coins
{
    class Coin
    {
        IWebDriver driver;

        [SetUp]

        public void startBrowser()
        {
            driver = new ChromeDriver(".");
        }


        [Test]
        public void test()
        {

        }

        [TearDown]

        public void closeBrowser()
        {
            driver.Close();
        }
    }
}
Number70
  • 453
  • 1
  • 4
  • 16
  • 1
    The error indicates one of many things 1) Server is not running 2) You do not have a route the to Server IP 3) Server is listening on a different port number 4) The connection is https (secure) and the security is failing. Do get more details you can use a sniffer like wireshark or fiddler which will give more information were the failure is occurring and the actual response error (or no response). – jdweng Dec 09 '19 at 17:38

1 Answers1

0

Please check your ".cs proj file" and ensure that there is no unwanted entry of older chromedriver. Remove the unwanted entry if any. Clean the solution and try. Hopefully this works..