|
@@ -254,29 +254,6 @@ public class ScreenshotUtil {
|
|
|
public static void main(String[] args) throws ExecutionException {
|
|
|
|
|
|
String OS = System.getProperty("os.name").toLowerCase();
|
|
|
- File file = new File("D:\\work\\data-analysis\\server\\src\\main\\resources\\chrome-driver\\linux\\chromedriver");
|
|
|
-
|
|
|
- if (!file.canExecute()) {
|
|
|
- if (!file.setExecutable(true)) {
|
|
|
- throw new ExecutionException(new Exception("D:\\work\\data-analysis\\server\\src\\main\\resources\\chrome-driver\\linux\\chromedriver" + " is not executable!"));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- System.setProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY, "D:\\work\\data-analysis\\server\\src\\main\\resources\\chrome-driver\\linux\\chromedriver");
|
|
|
- ChromeOptions options = new ChromeOptions();
|
|
|
-
|
|
|
- options.addArguments("headless");
|
|
|
- options.addArguments("no-sandbox");
|
|
|
- options.addArguments("disable-gpu");
|
|
|
- options.addArguments("disable-features=NetworkService");
|
|
|
- options.addArguments("ignore-certificate-errors");
|
|
|
- options.addArguments("silent-launch");
|
|
|
- options.addArguments("disable-application-cache");
|
|
|
- options.addArguments("disable-web-security");
|
|
|
- options.addArguments("no-proxy-server");
|
|
|
- options.addArguments("disable-dev-shm-usage");
|
|
|
- WebDriver driver = new ChromeDriver(options);
|
|
|
- System.out.println(driver.getTitle());
|
|
|
System.out.println(OS);
|
|
|
|
|
|
}
|