I am creating a class Library using .NetStandard and I have downloaded the following from the Selenium package from the NuGet Store
Now I have a simple test code
using System;
using Operation_Forage_V2;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
public class test
{
public static void Main(string[] args)
{
Uri Aurl = new Uri("https://www.youtube.com/");
IWebDriver aDriver;
aDriver = new ChromeDriver();
aDriver.Url = Aurl.OriginalString;
var element = aDriver.FindElement(By.ClassName("sa_wr"));
var innerHtml = element.GetAttribute("innerHTML");
Console.WriteLine(innerHtml.Substring(0, 100)); //just to see if it got the html
}
}
The problem is when I run the code (as console application), I get the following error
Ive seen similar problems on this websites, but they did not help me
I have no idea why this error is occurring especially given the driver and the right version of the driver has been downloaded using NuGet and the picture clearly shows it.