Method #1:
FirefoxDriverService service = FirefoxDriverService.CreateDefaultService(@"C:\selenium", "geckodriver.exe"); service.FirefoxBinaryPath = @"C:\Program Files (x86)\Mozilla Firefox\firefox.exe"; driver = new FirefoxDriver();
Actually when I do
Method #2:
driver = new FirefoxDriver();
Instructor
gunjan Replied on 01/12/2018If you have set the path of geckodriver.exe in the environment variable, then there is no need of passing the path in the code. So , then if you do it by Method2 , then that is also correct and there is no need of using the Method1.