burech
burech

Reputation: 41

Include Chromedriver In Your Application

I have developed several programs with selenium chromedriver. Getting the correct path to chromedriver on end users computer is sometimes an issue, how can I include the chromedriver exe in the program file, that it should automatically deploy and able to be used with messing around with the path to the driver file.

Upvotes: 1

Views: 952

Answers (1)

kmacdonald
kmacdonald

Reputation: 3471

  1. First you will need to add the exe to your project. Right click add existing item and navigate to the exe.
  2. secondly you need right click on the exe in your project and get to the properties. set the exe to copy to output directory -> copy if newer or copy always.

this should get the file publishing with your installation. this all depends on how you are deploying, but with clickOnce or web deploy this will work. Ultimately setting the copy to output directory will get the exe into your bin folder on build.

If you need the location of the exe you should be able to use something like System.Reflection.Assembly.GetExecutingAssembly().Location to get the location of where the execution is taking place.

Upvotes: 1

Related Questions