What is the best practice for using Firefox's geckodriver in a Selenium Automation Framework?

Refresh

4 weeks ago

Views

3 time

0

I've started trying out Selenium with Firefox and I've gotten it to work by downloading the gecko driver and referencing the file path in my code (I'm using C#):

FirefoxDriverService service = 
FirefoxDriverService.CreateDefaultService(@"C:\mypath\");

IWebDriver driver = new FirefoxDriver(service);

driver.Navigate().GoToUrl("http://google.com");

But I'm thinking about the bigger picture. What happens when it comes to my CI pipeline? Is it better to embed the driver file into my Visual Studio solution and reference it from there (is this even possible?) Or should I just make sure the driver is installed on the box that will be running the integration tests? Ideally I don't want to have the file path hard coded in my code.

What are people's thoughts? Does anyone else have any experience of working around this?

0 answers