Skip to content

Instantly share code, notes, and snippets.

@barancev
Last active August 29, 2015 13:56
Show Gist options
  • Save barancev/8832357 to your computer and use it in GitHub Desktop.
Save barancev/8832357 to your computer and use it in GitHub Desktop.
/* setters-style: */
// CommonOptions implements Options
CommonOptions commonOptions = new CommonOptions();
commonOptions.setProxy(...);
commonOptions.setOption("randomKey", "randomValue");
// FirefoxOptions implements Options
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.setNativeEvents(true);
// FirefoxDriver(Options options...)
WebDriver driver = new FirefoxDriver(commonOptions, firefoxOptions);
CommonOptions commonOptions = new CommonOptions();
commonOptions.setBrowser(FIREFOX);
commonOptions.setVersion("26");
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.setNativeEvents(true);
SauceOptions sauceOptions = new SauceOptions();
sauceOptions.recordVideo(false);
// RemoteWebDriver(URL url, Options options...)
WebDriver driver = new RemoteWebDriver(new URL(...), commonOptions, firefoxOptions, sauceOptions);
/* builder-style: */
Options commonOptions = new CommonOptions.Builder().setProxy(...).build();
Options firefoxOptions = new FirefoxOptions.Builder().setNativeEvents(true).build();
WebDriver driver = new FirefoxDriver(commonOptions, firefoxOptions);
Options commonOptions = new CommonOptions.Builder().setBrowser(FIREFOX).setVersion("26").build();
Options firefoxOptions = new FirefoxOptions.Builder().setNativeEvents(true).build();
Options sauceOptions = new SauceOptions.Builder().recordVideo(false).build();
WebDriver driver = new RemoteWebDriver(new URL(...), commonOptions, firefoxOptions, sauceOptions);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment