Updating .NET FirefoxDriver(FirefoxOptions) constructor
This update allows the user to specify `UseLegacyImplementation = true`
and not be required to have geckodriver available. Fixes issue
@@ -159,7 +159,7 @@ public FirefoxDriver(FirefoxBinary binary, FirefoxProfile profile, TimeSpan comm
/// </summary>
/// <param name="options">The <see cref="FirefoxOptions"/> to be used with the Firefox driver.</param>
public FirefoxDriver(FirefoxOptions options)
- : this(FirefoxDriverService.CreateDefaultService(), options, RemoteWebDriver.DefaultCommandTimeout)
+ : this(CreateService(options), options, RemoteWebDriver.DefaultCommandTimeout)
{
}
@@ -382,5 +382,15 @@ private static FirefoxProfile ExtractProfile(ICapabilities capabilities)
return profile;
}
+
+ private static FirefoxDriverService CreateService(FirefoxOptions options)
+ {
+ if (options != null && options.UseLegacyImplementation)
+ {
+ return null;
+ }
+
+ return FirefoxDriverService.CreateDefaultService();
+ }
}
}
