chris
chris

Reputation: 33

Selenium: embed chromeDriver into one exe

I have a program running selenium, and uses the chromedriver. However, I want my program to be 1 solid exe file. How can I embed the chrome driver into the exe so I do not have to have the main program, and chromedriver in a folder together in order to work.

Is this possible? C# visual studios

Upvotes: 3

Views: 794

Answers (1)

Naveen Kumar R B
Naveen Kumar R B

Reputation: 6398

I am not aware of C#, but following are some general guidelines to achieve the task:

  1. Add chromedriver.exe into the project folder (like /lib folder)
  2. Calculate absolute path from the relative path (project root folder/lib). relative path to the project root folder.
  3. Set absolute path in "webdriver.chrome.driver".
  4. While exporting include the .exe file.
  5. Try it out on new machine.

Upvotes: 1

Related Questions