|
@@ -219,24 +219,25 @@ public class ScreenshotUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// if(isLinux()){
|
|
|
-// CHROME_DRIVER_PATH += "/linux/chromedriver";
|
|
|
-// }
|
|
|
-// if(isWindows()){
|
|
|
-// CHROME_DRIVER_PATH += "/window";
|
|
|
-// }
|
|
|
- CHROME_DRIVER_PATH = "/app/resources/chrome-driver/linux/chromedriver";
|
|
|
- System.out.println("CHROME_DRIVER_PATH>>>"+ CHROME_DRIVER_PATH);
|
|
|
- File file = new File(CHROME_DRIVER_PATH);
|
|
|
+ String cpath = CHROME_DRIVER_PATH;
|
|
|
+ if(isLinux()){
|
|
|
+ cpath = CHROME_DRIVER_PATH + "/linux/chromedriver";
|
|
|
+ }
|
|
|
+ if(isWindows()){
|
|
|
+ cpath = CHROME_DRIVER_PATH + "/window";
|
|
|
+ }
|
|
|
+// CHROME_DRIVER_PATH = "/app/resources/chrome-driver/linux/chromedriver";
|
|
|
+ System.out.println("CHROME_DRIVER_PATH>>>"+ cpath);
|
|
|
+ File file = new File(cpath);
|
|
|
System.out.println("file type>>>"+ file.isFile());
|
|
|
System.out.println(file.getAbsolutePath()+"["+file.getName()+"]********************"+file.length());
|
|
|
if (!file.canExecute()) {
|
|
|
if (!file.setExecutable(true)) {
|
|
|
- throw new ExecutionException(new Exception(CHROME_DRIVER_PATH + " is not executable!"));
|
|
|
+ throw new ExecutionException(new Exception(cpath + " is not executable!"));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- System.setProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY, CHROME_DRIVER_PATH);
|
|
|
+ System.setProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY, cpath);
|
|
|
ChromeOptions options = new ChromeOptions();
|
|
|
|
|
|
options.addArguments("headless");
|