Package org.uiautomation.ios.wkrdp.model

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


  }

  @Override
  public Response handle() throws Exception {
    String ref = getRequest().getVariableValue(":reference");
    RemoteWebNativeBackedElement element = (RemoteWebNativeBackedElement) getWebDriver().createElement(ref);
    Point location = element.getLocation(RemoteWebElement.ElementPosition.TOP_LEFT);
    Response res = new Response();
    res.setSessionId(getSession().getSessionId());
    res.setStatus(0);
    res.setValue(location);
    return res;
View Full Code Here


  }

  @Override
  public Response handle() throws Exception {
    String ref = getRequest().getVariableValue(":reference");
    RemoteWebNativeBackedElement element = (RemoteWebNativeBackedElement) getWebDriver().createElement(ref);
    Dimension size = element.getSize();
    Response res = new Response();
    res.setSessionId(getSession().getSessionId());
    res.setStatus(0);
    res.setValue(size);
    return res;
View Full Code Here

    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);
      setJS(nativeTemplate.generate(request.getSession(), tapPoint.getX(), tapPoint.getY()));
    }
  }
View Full Code Here

        offset.getY()));
  }

  private void nativeScrollFromElement(WebDriverLikeRequest request, Dimension screenSize, String elementId,
                                       Point offset) throws Exception {
    RemoteWebNativeBackedElement element = (RemoteWebNativeBackedElement) getWebDriver().createElement(elementId);
    Point fromPoint = element.getLocation(RemoteWebElement.ElementPosition.CENTER);
    fromPoint = CoordinateUtils.forcePointOnScreen(fromPoint, screenSize);
    Point toPoint = new Point(
        fromPoint.getX() + offset.getX(),
        fromPoint.getY() + offset.getY());
    toPoint = CoordinateUtils.forcePointOnScreen(toPoint, screenSize);
View Full Code Here

    setJS(js);
  }

  private void nativeFlickFromElement(WebDriverLikeRequest request, Dimension screenSize, Point offset, double speed,
                                      String elementId) throws Exception {
    RemoteWebNativeBackedElement element = (RemoteWebNativeBackedElement) getWebDriver().createElement(elementId);
    Point fromPoint = element.getLocation(RemoteWebElement.ElementPosition.CENTER);
    Point toPoint = new Point(fromPoint.getX() + offset.getX(), fromPoint.getY() + offset.getY());
    fromPoint = CoordinateUtils.forcePointOnScreen(fromPoint, screenSize);
    toPoint = CoordinateUtils.forcePointOnScreen(toPoint, screenSize);
    int dx = toPoint.getX() - fromPoint.getX();
    int dy = toPoint.getY() - fromPoint.getY();
View Full Code Here

    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);
      setJS(nativeTemplate.generate(request.getSession(), tapPoint.getX(), tapPoint.getY()));
    }
  }
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

    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);
      setJS(nativeTemplate.generate(request.getSession(), tapPoint.getX(), tapPoint.getY()));
    }
  }
View Full Code Here

TOP

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

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.