I have checked YouTube & Google for solutions to this error. But I have not been able to get one.
Please, I get this error when I write some code to launch the Firefox driver:
An unhandled exception of type 'OpenQA.Selenium.DriverServiceNotFoundException' occurred in WebDriver.dll
Additional information: The geckodriver.exe file does not exist in the current directory or in a directory on the PATH environment variable. The driver can be downloaded at https://github.com/mozilla/geckodriver/releases.
Here is the code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using System.Threading.Tasks;
namespace FireFox_Driver_Launch
{
class Program
{
static void Main(string[] args)
{
var Driver = new FirefoxDriver();
Driver.Navigate().GoToUrl("http://www.starwoodhotels.com/preferredguest/account/enroll/index.html");
}
}
}
I have added the selenium webdriver package from "Manager Nuget Packages" as well.
I have searched this site & Google for a solution. But, I have not gotten a solution yet.
The firefox browser is installed on the PC.
I have downloaded the geckodriver. Please, how do I put it in the PATH?
I believe it should be in the System Environment variables ?
I have also installed Selenium.Firefox.Webdriver.
In addition, I downloaded the gecko driver & put it in the project folder. Still getting an error.