Package org.uiautomation.ios.communication

Examples of org.uiautomation.ios.communication.WebDriverLikeCommand


      public Object invoke(ExecuteMethod exec, Object self, Method method, Object... args) {
        RemoteWebDriver driver = (RemoteWebDriver) self;
        WebDriverLikeCommandExecutor executor = new WebDriverLikeCommandExecutor(driver);

        if ("setConfiguration".equals(method.getName())) {
          WebDriverLikeCommand command = (WebDriverLikeCommand) args[0];
          String key = (String) args[1];
          Object value = args[2];
          RemoteIOSDriver.setConfiguration(executor, command, key, value);
          return null;
        } else if ("getConfiguration".equals(method.getName())) {
          WebDriverLikeCommand command = (WebDriverLikeCommand) args[0];
          return RemoteIOSDriver.getConfiguration(executor, command);
        } else {
          throw new WebDriverException(method.getName() + " isn't recognized for Configurable");
        }
      }
View Full Code Here


  }

  @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 Response handle() throws Exception {
    String name = (String) getRequest().getVariableValue(":command");
    WebDriverLikeCommand command = WebDriverLikeCommand.valueOf(name);

    CommandConfiguration conf = getSession().configure(command);

    JSONObject res = new JSONObject();
    Map<String, Object> m = conf.getAll();
View Full Code Here

    super(driver, request);
  }

  @Override
  public Response handle() throws Exception {
    WebDriverLikeCommand
        command =
        WebDriverLikeCommand.valueOf(getRequest().getVariableValue(":command"));
    JSONObject payload = getRequest().getPayload();

    Iterator<String> iter = payload.keys();
View Full Code Here

  }

  private String getFinalJS(JSTemplate template) {
    String reference = getRequest().hasVariable(":reference") ? getRequest().getVariableValue(":reference")
        : ":reference";
    WebDriverLikeCommand command = getRequest().getGenericCommand();
    CommandMapping mapping = CommandMapping.get(command);
    String jsMethod = mapping.jsMethod(getRequest().getPayload());
    String sessionId = getRequest().getSession();

    return template.generate(sessionId, reference, jsMethod);
View Full Code Here

    }

    // otherwise,forward to the driver to get the response.
    Level level = Level.FINE;
    long startTime = System.currentTimeMillis();
    WebDriverLikeCommand wdlc = null;
    try {
      wdlc = request.getGenericCommand();
      Handler h = CommandMapping.get(wdlc).createHandler(getDriver(), request);
      return h.handleAndRunDecorators();
    } catch (Exception we) {
      Response response = new Response();

      response.setStatus(errorCodes.toStatusCode(we));

      if (wdlc != null && wdlc.isSessionLess()) {
        response.setSessionId("");
      } else {
        response.setSessionId(request.getSession());
      }
View Full Code Here

TOP

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

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.