Package org.openqa.selenium

Examples of org.openqa.selenium.WebDriverException


  }

  public static APPIOSApplication findSafariApp(File xcodeInstall, String sdkVersion) {
    File safariFolder = findSafariLocation(xcodeInstall, sdkVersion);
    if (!safariFolder.exists()) {
      throw new WebDriverException(safariFolder + " should be the safari app, but doesn't exist.");
    }
    return new APPIOSApplication(safariFolder.getAbsolutePath());
  }
View Full Code Here


    Command c = new Command(cmd, false);
    c.executeAndWait();

    if (c.getStdOut().size() != 1) {
      throw new WebDriverException("cannot find XCode location." + c.getStdOut());
    }

    String path = c.getStdOut().get(0);

    String pattern = ".app/";
View Full Code Here

          rearrangedArray.setValue(index, d);
          index++;
        }
      }
      if (defaultDevice == null) {
        throw new WebDriverException(
            "Cannot find device " + device + " in the supported device list.");
      }
      rearrangedArray.setValue(putDefaultFirst ? 0 : index, defaultDevice);
      root.put("UIDeviceFamily", rearrangedArray);

      write(plist, root, format);
    } catch (Exception e) {
      throw new WebDriverException("Cannot change the default device for the app." + e.getMessage(), e);
    }
  }
View Full Code Here

    else {
      // on Xcode 6 and newer, 'instruments -s' lists the names of the templates, not their locations.
      // so if it didn't tell us where the template is, search for it ourselves.
      List<String> findResults = findAutomationTemplate(templateName);
      if (findResults.size() == 0) {
          throw new WebDriverException("Unable to find the instruments template " + templateName);
      }
      path = findResults.get(0);
    }
    path = path.replaceFirst(",", "");
    path = path.replaceAll("\"", "");
    path = path.trim();
    File f = new File(path);
    if (!f.exists()) {
      throw new WebDriverException(f + "isn't a valid template.");
    }
    return f;
  }
View Full Code Here

      favorite.put("URL", "about:blank");
      root.setValue(0, favorite);

      write(builtinFavoritesPList, root, format);
    } catch (Exception e) {
      throw new WebDriverException("Cannot set " + builtinFavoritesPList.getAbsolutePath()
                                   + ": " + e.getMessage(), e);
    }
  }
View Full Code Here

        return tmp.split("/")[0];
      } else {
        return tmp;
      }
    } else {
      throw new WebDriverException("cannot extract session id from " + pathInfo);
    }
  }
View Full Code Here

      try {
        Object value = getMetadata().get(key);
        cap.setCapability(key, value);
      } catch (JSONException e) {
        throw new WebDriverException("cannot get metadata", e);
      }
    }
    return cap;
  }
View Full Code Here

    if (desiredCapabilities.getCapability(IOSCapabilities.SIMULATOR) != null &&
        desiredCapabilities.isSimulator() != appCapability.isSimulator()) {
      return false;
    }
    if (desiredCapabilities.getBundleName() == null) {
      throw new WebDriverException("you need to specify the bundle to test.");
    }
    String desired = desiredCapabilities.getBundleName();

    String bundleName = (String) appCapability.getCapability(IOSCapabilities.BUNDLE_NAME);
    String displayName = (String) appCapability.getCapability(IOSCapabilities.BUNDLE_DISPLAY_NAME);
    String name = bundleName != null ? bundleName : displayName;

    if (!desired.equals(name)) {
      return false;
    }
    if (desiredCapabilities.getBundleVersion() != null && !desiredCapabilities.getBundleVersion()
        .equals(appCapability.getBundleVersion())) {
      return false;
    }
    if (desiredCapabilities.getDevice() == null) {
      throw new WebDriverException("you need to specify the device.");
    }
    if (!appCapability.getSupportedDevices().contains(desiredCapabilities.getDevice())) {
      return false;
    }
View Full Code Here

          families.add(DeviceType.ipad);
        }
      }
      return families;
    } catch (JSONException e) {
      throw new WebDriverException(e);
    }
  }
View Full Code Here

  public void start(long timeOut) throws InstrumentsFailedToStartException {

    try {
      service.startSafari();
    } catch (IOException | SDKException e) {
      throw new WebDriverException("Cannot start safari : " + e.getMessage(), e);
    }

    Response r = session.getCachedCapabilityResponse();
    if (r == null) {
      r = new Response();
View Full Code Here

TOP

Related Classes of org.openqa.selenium.WebDriverException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.