Skip to content

Commit 8c75a2c

Browse files
committed
Include extra options in Chromium tests
1 parent 59f65c6 commit 8c75a2c

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

selenium-webdriver-junit4/src/test/java/io/github/bonigarcia/webdriver/junit4/ch02/helloworld_otherbrowsers/HelloWorldChromiumJUnit4Test.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ public static void setupClass() {
5555
@Before
5656
public void setup() {
5757
ChromeOptions options = new ChromeOptions();
58-
options.addArguments("--remote-debugging-port=" + findFreePort());
5958
options.setBinary(browserPath.get().toFile());
59+
options.addArguments("--no-sandbox");
60+
options.addArguments("--disable-gpu");
61+
options.addArguments("--disable-dev-shm-usage");
62+
options.addArguments("--remote-debugging-port=" + findFreePort());
6063
driver = new ChromeDriver(options);
6164
}
6265

selenium-webdriver-junit5/src/test/java/io/github/bonigarcia/webdriver/jupiter/ch02/helloworld_otherbrowsers/HelloWorldChromiumJupiterTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ static void setupClass() {
5555
@BeforeEach
5656
void setup() {
5757
ChromeOptions options = new ChromeOptions();
58-
options.addArguments("--remote-debugging-port=" + findFreePort());
5958
options.setBinary(browserPath.get().toFile());
59+
options.addArguments("--no-sandbox");
60+
options.addArguments("--disable-gpu");
61+
options.addArguments("--disable-dev-shm-usage");
62+
options.addArguments("--remote-debugging-port=" + findFreePort());
6063
driver = new ChromeDriver(options);
6164
}
6265

selenium-webdriver-testng/src/test/java/io/github/bonigarcia/webdriver/testng/ch02/helloworld_otherbrowsers/HelloWorldChromiumNGTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ public void setupClass() {
5555
@BeforeMethod
5656
public void setup() {
5757
ChromeOptions options = new ChromeOptions();
58-
options.addArguments("--remote-debugging-port=" + findFreePort());
5958
options.setBinary(browserPath.get().toFile());
59+
options.addArguments("--no-sandbox");
60+
options.addArguments("--disable-gpu");
61+
options.addArguments("--disable-dev-shm-usage");
62+
options.addArguments("--remote-debugging-port=" + findFreePort());
6063
driver = new ChromeDriver(options);
6164
}
6265

0 commit comments

Comments
 (0)