Skip to content

Commit

Permalink
#1 Use Firefox in Headless-Mode
Browse files Browse the repository at this point in the history
- Add FirefoxOptions to set the headless mode
  • Loading branch information
helkv committed Jan 22, 2020
1 parent da3d092 commit 98f06f8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/test/java/testconfiguration/TestConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
Expand Down Expand Up @@ -40,7 +41,10 @@ public WebDriver initializeWebDriver() {

WebDriverManager.firefoxdriver().setup();

WebDriver driver = new FirefoxDriver();
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.setHeadless(true);

WebDriver driver = new FirefoxDriver(firefoxOptions);

return driver;
}
Expand Down

0 comments on commit 98f06f8

Please sign in to comment.