user3723186
user3723186

Reputation: 37

How to setup geckodriver.exe file on .Net environment

I was trying to run the geckodriver on VS, but I get an error:"Test Failed, OneTimeSetUp: OpenQA.Selenium.DriverServiceNotFoundException: The geckdriver.exe file does not exist in the current directory path environment variable. The driver can be downloaded at https://github.com/mozilla/geckdriver/releases.

I have already got the correct path setup with the latest version of geckodriver 1.11 but for some reason I tried troubleshooting every way I could but no luck.

Below is my test code I was trying to run the .exe file

FirefoxDriverService service = FirefoxDriverService.CreateDefaultService(@"C:\Users\Test\Downloads\geckodriver-v0.11.1-win64\geckodriver.exe");
        service.Port = 64444;
        service.FirefoxBinaryPath = @"C:\Program Files (x86)\Mozilla Firefox\firefox.exe";
        service.HideCommandPromptWindow = true;
        service.SuppressInitialDiagnosticInformation = true;
        IWebDriver Driver = new FirefoxDriver(service);

Upvotes: 1

Views: 2067

Answers (1)

Sachin Poreyana
Sachin Poreyana

Reputation: 2077

One way I solved this is by Placing the drivers inside /bin/debug directory. for example Visual Studio/projects/projname/projname/bin/debug/. Hope it helps. Cheers

Upvotes: 1

Related Questions