Created
December 21, 2017 19:43
-
-
Save diemol/1a0c15eccdc3712a76a5a3782e5c4fbd to your computer and use it in GitHub Desktop.
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
FirefoxProfile firefoxHeadlessProfile = new FirefoxProfile | |
{ | |
DeleteAfterUse = true | |
}; | |
firefoxHeadlessProfile.SetPreference("browser.cache.disk.enable", false); | |
firefoxHeadlessProfile.SetPreference("browser.cache.memory.enable", false); | |
firefoxHeadlessProfile.SetPreference("browser.cache.offline.enable", false); | |
firefoxHeadlessProfile.SetPreference("network.http.use-cache", false); | |
FirefoxOptions firefoxHeadlessOptions = new FirefoxOptions | |
{ | |
Profile = firefoxHeadlessProfile | |
}; | |
firefoxHeadlessOptions.AddArgument("--headless"); | |
// Cast to DesiredCapabilities from the ICapabilities interface to make it mutable | |
DesiredCapabilities desiredCapabilities = (DesiredCapabilities) firefoxHeadlessOptions.ToCapabilities(); | |
desiredCapabilities.SetCapability("idleTimeout", 300); | |
desiredCapabilities.SetCapability("tz", "America/Chicago"); | |
desiredCapabilities.SetCapability("recordVideo", EnableZaleniumVideoRecording); | |
IWebDriver WebDriver = new RemoteWebDriver(GridHubUri, desiredCapabilities, GridCommandTimeout); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment