Selenium.WebDriver - I get error when I try to run my test in Chrome

Install Selenium.Chrome.WebDriver NuGet package to the project and you will not get the error again.

In Visual Studio, right click the Project, click Manage NuGet Packages... , Search for Selenium.Chrome.WebDriver and click install.

Enjoy Selenium.


Finally I resolved my issue as follows:

1) I copied chromedriver.exe in Chrome directory link, but you can put it in any directory. I decided to put it here.

2) I Initialized a new instance of the ChromeDriver class using the specified // path to the directory containing ChromeDriver.exe

My code:

IWebDriver drive = new ChromeDriver
("C:\\Documents and Settings\\...\\ApplicationData\\Google\\Chrome\\Application");

And it works just perfect. Thanks All.


Lets assume chromedriver.exe is present in below path: G:\Selenium_Csharp\Jar\chromedriver_win32\chromedriver.exe

To execute your test in Chrome set the path to the directory/folder containing chromedriver.exe without selecting chromedriver.exe file name.

driver = new ChromeDriver("G:\\Selenium_Csharp\\Jar\\chromedriver_win32");

driver.Url ="http://www.gmail.com";
driver.Manage().Window.Maximize();

OR

driver = new ChromeDriver(@"G:\Selenium_Csharp\\Jar\\chromedriver_win32");

driver.Url ="http://www.gmail.com";
driver.Manage().Window.Maximize();