Package org.uiautomation.ios.communication

Examples of org.uiautomation.ios.communication.Path


  }

  @Override
  public JSONObject logElementTree(File screenshot, boolean translation) throws Exception {
    WebDriverLikeCommand command = WebDriverLikeCommand.TREE;
    Path
        p =
        new Path(command).withSession(getDriver().getSessionId()).withReference(getReference());
    return logElementTree(screenshot, translation, p, command, getDriver());
  }
View Full Code Here


  @Override
  public void set(String key, Object value) {
    try {
      JSONObject payload = new JSONObject().put(key, value);
      Path p = new Path(WebDriverLikeCommand.CONFIGURE);
      // session/:sessionId/configure/command/:command
      p.validateAndReplace(":sessionId", driver.getSessionId().toString());
      p.validateAndReplace(":command", command.name());
      WebDriverLikeRequest request = new WebDriverLikeRequest("POST", p, payload);
      //driver.execute(request);
    } catch (Exception e) {
      log.log(Level.SEVERE, "Configure failed.", e);
    }
View Full Code Here

      // mocking a request to SET_TIMEOUT
      JSONObject payload = new JSONObject();
      payload.append("ms", SetImplicitWaitTimeoutNHandler.TIMEOUT);
      WebDriverLikeRequest
          wdlr =
          new WebDriverLikeRequest("POST", new Path(WebDriverLikeCommand.SET_TIMEOUT), payload);

      // set the timeout by 'handling' the request, we don't care about it's response.
      try {
        CommandMapping.SET_TIMEOUT.createHandler(getServer(), wdlr).handle();
      } catch (Exception e) {
View Full Code Here

  public WebDriverLikeRequest buildRequest(WebDriverLikeCommand command, RemoteUIAElement element,
                                           Map<String, ?> params,
                                           Map<String, String> extraParamInPath) {
    String method = command.method();
    Path p = new Path(command).withSession(driver.getSessionId());
    if (element != null) {
      p.withReference(element.getReference());
    }
    for (String key : extraParamInPath.keySet()) {
      p.validateAndReplace(":" + key, extraParamInPath.get(key));
    }
    WebDriverLikeRequest request = new WebDriverLikeRequest(method, p, params);
    return request;
  }
View Full Code Here

    public WebDriverLikeRequest buildRequest(WebDriverLikeCommand command,
                                             RemoteUIAElement element,
                                             Map<String, ?> params,
                                             Map<String, String> extraParamInPath) {
      String method = command.method();
      Path p = new Path(command).withSession(getSessionId());
      // it's ok to have an element id but not mentioning it in the path. That's typically the case
      // for alerts.
      if (element != null && p.getPath().contains(Path.REFERENCE)) {
        p.withReference(element.getReference());
      }

      ImmutableMap.Builder<String, Object> builder = new ImmutableMap.Builder<String, Object>();
      builder.put("native", true);
      if (params != null) {
        builder.putAll(params);
      }

      for (String key : extraParamInPath.keySet()) {
        p.validateAndReplace(":" + key, extraParamInPath.get(key));
      }
      WebDriverLikeRequest request = new WebDriverLikeRequest(method, p, builder.build());
      return request;
    }
View Full Code Here

TOP

Related Classes of org.uiautomation.ios.communication.Path

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.