Skip to content

Instantly share code, notes, and snippets.

@slawekradzyminski
Last active February 21, 2016 21:17
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 slawekradzyminski/397193a8c06d61e1ded6 to your computer and use it in GitHub Desktop.
Save slawekradzyminski/397193a8c06d61e1ded6 to your computer and use it in GitHub Desktop.
private static final String PREFS = "prefs";
@Override
public WebDriver getDefaultDriver() {
return new ChromeDriver(getChromeCapabilities());
}
private DesiredCapabilities getChromeCapabilities() {
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability(ChromeOptions.CAPABILITY, getChromeOptions());
return capabilities;
}
private ChromeOptions getChromeOptions() {
ChromeOptions options = new ChromeOptions();
options.addArguments(getChromeSwitches());
options.setExperimentalOption(PREFS, getChromePrefs());
return options;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment