When setting up the browser:
All tutorials show this:
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
driver = new FirefoxDriver();
Instructorgunjan Reply on 01/12/2018
If 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.