Skip to content

Instantly share code, notes, and snippets.

@elgatov
Created October 11, 2018 14:11
Show Gist options
  • Save elgatov/132c0c0a655e7a9357de8f47d0f77e07 to your computer and use it in GitHub Desktop.
Save elgatov/132c0c0a655e7a9357de8f47d0f77e07 to your computer and use it in GitHub Desktop.
public static RemoteWebDriver GenerarRemotoChromeDriver()
{
//DesiredCapabilities capability = DesiredCapabilities.Chrome();
var chromeOptions = new ChromeOptions();
chromeOptions.AddArguments("no-sandbox");
chromeOptions.AddArguments("disable-infobars");
chromeOptions.AddArguments("disable-notifications");
chromeOptions.AddArguments("--start-maximized");
chromeOptions.AddUserProfilePreference("profile.default_content_settings.popups", 0);
chromeOptions.SetLoggingPreference(LogType.Browser, (LogLevel)GlobalSettings.LogLevel);
//capability.SetCapability(ChromeOptions.Capability, chromeOptions.ToString());
//return new RemoteWebDriver(UriServerHubSelenium, capability, TimeSpan.FromSeconds(90));
return new RemoteWebDriver(UriServerHubSelenium, chromeOptions.ToCapabilities(), TimeSpan.FromSeconds(10));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment