Created
August 13, 2013 02:43
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); }); | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
+1 - Have the same question as shootdaj above.