Skip to content

Instantly share code, notes, and snippets.

@xkr47
Created March 14, 2014 06:45
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 xkr47/9543086 to your computer and use it in GitHub Desktop.
Save xkr47/9543086 to your computer and use it in GitHub Desktop.
How to set up webdriver to optionally use alternative DISPLAY setting for browser
FirefoxBinary firefox = new FirefoxBinary();
// allow user to specify which DISPLAY to use if running e.g. Xephyr
String display = System.getProperty("firefoxDisplay");
if (display != null) {
firefox.setEnvironmentProperty("DISPLAY", display);
}
WebDriver driver = new FirefoxDriver(firefox, null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment