Skip to content
Permalink
Browse files

always use headless firefox

  • Loading branch information...
pabender committed Mar 4, 2019
1 parent 38f2c3f commit 6df92e6285d7a232db2ecd38cf463b34752c1c8f
Showing with 6 additions and 11 deletions.
  1. +6 −11 java/test/jmri/util/web/BrowserFactory.java
@@ -37,17 +37,12 @@ public static EventFiringWebDriver getBrowser(String browserName) {
case "Firefox":
driver = drivers.get("Firefox");
if (driver == null) {
WebDriverManager.getInstance(FirefoxDriver.class).setup();
FirefoxBinary firefoxBinary = new FirefoxBinary();
FirefoxOptions firefoxOptions = new FirefoxOptions();
if(GraphicsEnvironment.isHeadless()) {
firefoxBinary.addCommandLineOptions("--headless");
firefoxOptions.setBinary(firefoxBinary);
firefoxOptions.setLogLevel(org.openqa.selenium.firefox.FirefoxDriverLogLevel.ERROR);
} else {
firefoxOptions.setBinary(firefoxBinary);
firefoxOptions.setLogLevel(org.openqa.selenium.firefox.FirefoxDriverLogLevel.ERROR);
}
WebDriverManager.getInstance(FirefoxDriver.class).setup();
FirefoxBinary firefoxBinary = new FirefoxBinary();
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxBinary.addCommandLineOptions("--headless");
firefoxOptions.setBinary(firefoxBinary);
firefoxOptions.setLogLevel(org.openqa.selenium.firefox.FirefoxDriverLogLevel.ERROR);
driver = new EventFiringWebDriver(new FirefoxDriver(firefoxOptions));
driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
drivers.put("Firefox", driver);

0 comments on commit 6df92e6

Please sign in to comment.
You can’t perform that action at this time.