Skip to content

Commit

Permalink
Fix removed setHeadless method.
Browse files Browse the repository at this point in the history
  • Loading branch information
ham1 committed Oct 3, 2023
1 parent 306ba22 commit 368c9fc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ public class ChromeImpl extends AbstractDriver {
@Override
public ChromeOptions getCapabilities() {
var chromeOptions = new ChromeOptions();
chromeOptions.setHeadless(Property.HEADLESS.getBoolean());
if (Property.HEADLESS.getBoolean()) {
chromeOptions.addArguments("--headless=new");
}
return chromeOptions;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ public class FirefoxImpl extends AbstractDriver {
@Override
public FirefoxOptions getCapabilities() {
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.setHeadless(Property.HEADLESS.getBoolean());
if (Property.HEADLESS.getBoolean()) {
firefoxOptions.addArguments("--headless");
}
firefoxOptions.setLogLevel(FirefoxDriverLogLevel.INFO);
return firefoxOptions;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ public class CustomFirefoxImpl extends AbstractDriver {
@Override
public Capabilities getCapabilities() {
var firefoxOptions = new FirefoxOptions();
firefoxOptions.setHeadless(Property.HEADLESS.getBoolean());
if (Property.HEADLESS.getBoolean()) {
firefoxOptions.addArguments("--headless");
}
return firefoxOptions;
}

Expand Down

0 comments on commit 368c9fc

Please sign in to comment.