Single exe file embedding both chromedriver and geckodriver into it

0 votes

So, I have a Selenium Project in .exe form and I want the ChromeDriver and GeckoDriver files as a part of the .exe Selenium project, combining it into a single .exe file with all of it.

I think it can be done, but how?

Aug 11, 2018 in Selenium by Bharani
• 4,660 points
1,318 views

1 answer to this question.

0 votes
Yeah, it is possible.

You could start by adding the ChromeDriver.exe file to your Selenium project as an embedded resource. You can refer here for more details on how to do that: https://support.microsoft.com/en-us/help/319292/how-to-embed-and-access-resources-by-using-visual-c This way, the ChromeDriver.exe gets embedded into your compiled application and upon starting the application, you just have to read that embedded resource in the form of a stream of bytes and write the same to a new file and save this file with the name ChromeDriver.exe. Now, your application will invoke ChromeDriver.exe from within itself. Finally, just instantiate the ChromeDriver class and pass the path to the newly created ChromeDriver.exe file. But just embedding ChromeDriver.exe isn't enough as you'll also need all the references, including Webdriver.dll in the folder where your application is. And, .net applications get installed just by copying the folder, but not just the file. So, you can embed all needed .dlls that you need in your project and load them whenever the application starts, but that's a huge overkill for most cases. So, rather deploy a folder instead of a single file and you'll just need to add ChromeDriver.exe to that output folder (add it to your project as a content file with the Copy Always setting). And, save all the work of invoking it from the resource.
answered Aug 11, 2018 by DataKing99
• 8,240 points

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer

How to extract text from a web page using selenium and save it as a text file?

Hello Isha, you can checkout this code ...READ MORE

answered May 7, 2019 in Selenium by Anvi
• 14,150 points
33,129 views
+1 vote
1 answer

Is it possible to write data into an excel file using Selenium Webdriver?

Hi Simran, if you want to directly ...READ MORE

answered May 8, 2019 in Selenium by Abha
• 28,140 points
6,487 views
0 votes
1 answer

Selenium ChromeDriver issue - Want to run it in background, but not as headless browser

This is a flaw with ChromeDriver. Tried ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,500 points
7,462 views
0 votes
1 answer

How should I configure the chromedriver.exe in eclipse

Use the page factory pattern, working example: public ...READ MORE

answered Mar 27, 2018 in Selenium by ffdfd
• 5,550 points
19,160 views
0 votes
1 answer

Where do I get the ChromeDriver.exe from? The download link isn't available

You can download the chromedriver.exe from this ...READ MORE

answered Apr 3, 2018 in Selenium by nsv999
• 5,500 points
14,987 views
0 votes
1 answer

How do we use Gecko driver.exe with Selenium?

Recently Selenium launched v3 and if you ...READ MORE

answered Apr 7, 2018 in Selenium by nsv999
• 5,500 points
524 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
12,697 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP