Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to put chromedriver.exe for release of Selenium WebDriver C#

I have my chromedriver.exe in my local documents, working fine. But it's time to deploy to production. Somehow I need to bundle it with my software, and reference it locally.

How do I go about locally referencing my driver, and where should I put it?

like image 951
User Avatar asked Jun 23 '16 15:06

User


People also ask

Where should I put ChromeDriver for Selenium?

Now we need to move ChromeDriver somewhere that Python and Selenium will be able to find it (a.k.a. in your PATH ). The easiest place to put it is in C:\Windows . So move it there!


1 Answers

Copy Chromedriver.exe into your project's solution / project folder. Add it to the project in visual studio. Right click the file and choose properties. Build Action should be set to 'Content'. That will mean when you build/deploy the bin folder will contain a copy of the chromedriver. When you reference the chromedriver.exe directly, you should look for it adjacent to the executable path of your program.

Good source on detecting location of current assembly/executable: How do I get the path of the assembly the code is in?

like image 64
Richthofen Avatar answered Sep 25 '22 08:09

Richthofen