Package org.uiautomation.ios.wkrdp.model

Examples of org.uiautomation.ios.wkrdp.model.NodeId


    if (params.has("node")) {
      params = params.getJSONObject("node");
    }
    int nodeId = params.getInt("nodeId");

    this.node = new NodeId(nodeId);
    this.parent = new NodeId(parentNodeId);

  }
View Full Code Here


    super(message);

    JSONObject params = message.optJSONObject("params").getJSONObject("node");

    JSONObject json = params.getJSONObject("contentDocument");
    contentDocument = new NodeId(json.getInt("nodeId"));
  }
View Full Code Here

    super(driver, request);

    JSONObject payload = request.getPayload();
    String elementId = payload.optString("element");
    if (RemoteIOSWebDriver.isPlainElement(elementId)) {
      NodeId nodeId = RemoteIOSWebDriver.plainNodeId(elementId);
      setJS(plainTemplate.generate(request.getSession(), nodeId.getId()));
    } else {
      Dimension screenSize = getNativeDriver().getScreenSize();
      RemoteWebNativeBackedElement element = (RemoteWebNativeBackedElement) getWebDriver().createElement(elementId);
      Point tapPoint = element.getLocation(RemoteWebElement.ElementPosition.CENTER);
      tapPoint = CoordinateUtils.forcePointOnScreen(tapPoint, screenSize);
View Full Code Here

    Dimension screenSize = getNativeDriver().getScreenSize();
    Point offset = new Point(payload.getInt("xoffset"), payload.getInt("yoffset"));
    String elementId = payload.optString("element");
    if (!payload.isNull("element") && !elementId.equals("")) {
      if (RemoteIOSWebDriver.isPlainElement(elementId)) {
        NodeId nodeId = RemoteIOSWebDriver.plainNodeId(elementId);
        plainScrollFromElement(request, screenSize, nodeId.getId(), offset);
      } else {
        nativeScrollFromElement(request, screenSize, elementId, offset);
      }
    } else {
      scrollFromCenter(request, screenSize, offset);
View Full Code Here

    String elementId = payload.optString("element");
    if (!payload.isNull("element") && !elementId.equals("")) {
      Point offset = new Point(payload.getInt("xoffset"), payload.getInt("yoffset"));
      double speed = payload.optDouble("speed", 1.0);
      if (RemoteIOSWebDriver.isPlainElement(elementId)) {
        NodeId nodeId = RemoteIOSWebDriver.plainNodeId(elementId);
        plainFlickFromElement(request, screenSize, offset, speed, nodeId.getId());
      } else {
        nativeFlickFromElement(request, screenSize, offset, speed, elementId);
      }
    } else {
      double speedX = payload.optDouble("xspeed", 1.0);
View Full Code Here

    super(driver, request);

    JSONObject payload = request.getPayload();
    String elementId = payload.optString("element");
    if (RemoteIOSWebDriver.isPlainElement(elementId)) {
      NodeId nodeId = RemoteIOSWebDriver.plainNodeId(elementId);
      setJS(plainTemplate.generate(request.getSession(), nodeId.getId()));
    } else {
      Dimension screenSize = getNativeDriver().getScreenSize();
      RemoteWebNativeBackedElement element = (RemoteWebNativeBackedElement) getWebDriver().createElement(elementId);
      Point tapPoint = element.getLocation(RemoteWebElement.ElementPosition.CENTER);
      tapPoint = CoordinateUtils.forcePointOnScreen(tapPoint, screenSize);
View Full Code Here

  public static boolean isPlainElement(String elementId) {
    return (elementId.split("_").length == 1);
  }

  public static NodeId plainNodeId(String elementId) {
    return new NodeId(Integer.parseInt(elementId));
  }
View Full Code Here

      throw new StaleElementReferenceException("Node " + nodeId
                                               + "is stale.It might still exist, but the "
                                               + "window with focus has changed.");
    }
    if (session != null) {
      return new RemoteWebNativeBackedElement(new NodeId(nodeId), currentInspector, session);
    } else {
      return new RemoteWebElement(new NodeId(nodeId), currentInspector);
    }
  }
View Full Code Here

    return result;
  }


  public RemoteWebElement getMainWindow() {
    return new RemoteWebElement(new NodeId(0), this);
  }
View Full Code Here


  private RemoteWebElement retrieveDocument() throws Exception {
    JSONObject result = sendCommand(DOM.getDocument());
    JSONObject root = result.getJSONObject("root");
    RemoteWebElement rme = new RemoteWebElement(new NodeId(root.getInt("nodeId")), this);
    return rme;
  }
View Full Code Here

TOP

Related Classes of org.uiautomation.ios.wkrdp.model.NodeId

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.