コード例 #1
0
 private static void loadInternetExplorerDriverPath(String path) {
   PropertyUtils.setPropertyIfNotExists(
       IE_DRIVER_PROPERTY_NAME,
       System.getProperty(
           INTERNET_EXPLORER_DRIVER_PROPERTY_NAME)); // Alternative property name that follows
                                                     // naming convention
   PropertyUtils.setPropertyIfNotExists(IE_DRIVER_PROPERTY_NAME, path);
   PropertyUtils.setPropertyIfNotExists(
       IE_DRIVER_PROPERTY_NAME, getInternetExplorerDriverDefaultPath());
 }
コード例 #2
0
 private static String getInternetExplorerDriverDefaultPath() {
   if (OsUtils.isWindows()) {
     if (!PropertyUtils.propertyExists(IE_DRIVER_USE64BIT_PROPERTY_NAME)
         || !PropertyUtils.propertyExists(INTERNET_EXPLORER_DRIVER_USE64BIT_PROPERTY_NAME)) {
       if (OsUtils.isWindows10()) {
         return "drivers/internetexplorerdriver-windows-64bit.exe";
       } else {
         return "drivers/internetexplorerdriver-windows-32bit.exe";
       }
     } else {
       if (PropertyUtils.isTrue(IE_DRIVER_USE64BIT_PROPERTY_NAME)
           || PropertyUtils.isTrue(INTERNET_EXPLORER_DRIVER_USE64BIT_PROPERTY_NAME)) {
         return "drivers/internetexplorerdriver-windows-64bit.exe";
       } else {
         return "drivers/internetexplorerdriver-windows-32bit.exe";
       }
     }
   }
   return null;
 }
コード例 #3
0
 private static void loadPhantomJsDriverPath(String path) {
   PropertyUtils.setPropertyIfNotExists(PHANTOMJS_BINARY_PROPERTY_NAME, path);
   PropertyUtils.setPropertyIfNotExists(PHANTOMJS_BINARY_PROPERTY_NAME, getPhantomJsDefaultPath());
 }
コード例 #4
0
 private static void loadEdgeDriverPath(String path) {
   PropertyUtils.setPropertyIfNotExists(EDGE_DRIVER_PROPERTY_NAME, path);
   PropertyUtils.setPropertyIfNotExists(EDGE_DRIVER_PROPERTY_NAME, getEdgeDefaultPath());
 }
コード例 #5
0
 private static void loadFirefoxDriverPath(String path) {
   PropertyUtils.setPropertyIfNotExists(FIREFOX_DRIVER_PROPERTY_NAME, path);
   PropertyUtils.setPropertyIfNotExists(
       FIREFOX_DRIVER_PROPERTY_NAME, getFirefoxDriverDefaultPath());
 }
コード例 #6
0
 private static void loadChromeDriverPath(String path) {
   PropertyUtils.setPropertyIfNotExists(CHROME_DRIVER_PROPERTY_NAME, path);
   PropertyUtils.setPropertyIfNotExists(CHROME_DRIVER_PROPERTY_NAME, getChromeDriverDefaultPath());
 }