Skip to content

Instantly share code, notes, and snippets.

@stirno
Created August 13, 2013 02:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stirno/6217404 to your computer and use it in GitHub Desktop.
Save stirno/6217404 to your computer and use it in GitHub Desktop.
Sample for changing the settings used for a web driver instance - Need to make this suck less
public class ThisIsATestClass : FluentTest
{
public ThisIsATestClass()
{
FluentAutomation.SeleniumWebDriver.Bootstrap(FluentAutomation.SeleniumWebDriver.Browser.Chrome);
var containerRegistration = FluentAutomation.Settings.Registration;
FluentAutomation.Settings.Registration = (container) =>
{
// Call default registration method from Bootstrapper
containerRegistration(container);
// Custom configure chrome with the IoC provider
var driverPath = EmbeddedResources.UnpackFromAssembly("chromedriver.exe", Assembly.GetAssembly(typeof(SeleniumWebDriver)));
var chromeOptions = new ChromeOptions();
chromeOptions.AddAdditionalCapability("acceptSslCerts", true);
container.Register<IWebDriver>((c, o) => { return new ChromeDriver(Path.GetDirectoryName(driverPath), chromeOptions); });
};
}
}
@shootdaj
Copy link

Has this been updated since the time of writing? FluentAutomation.Settings no longer exists. And FluentAutomation.FluentSettings does not have the Registration property.

@code-ninja-sh
Copy link

+1 - Have the same question as shootdaj above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment