Skip to content

Commit 1cb0724

Browse files
Update SeleniumConfig.java
1 parent b97281c commit 1cb0724

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Testauto/src/main/java/com/sm/config/SeleniumConfig.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@
1010
public class SeleniumConfig {
1111

1212
@Bean
13-
WebDriver webDriver() {
13+
WebDriver webDriver() throws IOException {
1414
ChromeOptions options = new ChromeOptions();
1515
options.addArguments("--headless");
16+
options.addArguments("--no-sandbox");
17+
options.addArguments("--disable-dev-shm-usage");
18+
String tempProfileDir = Files.createTempDirectory("chrome-profile-").toString();
19+
options.addArguments("--user-data-dir=" + tempProfileDir);
1620
return new ChromeDriver();
1721
}
1822
}

0 commit comments

Comments
 (0)