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();
}
}
}