Package org.openqa.selenium

Examples of org.openqa.selenium.Point


  }

  private String getNativeElementClickOnIt() throws Exception {
    // web stuff.
    scrollIntoViewIfNeeded();
    Point location = getLocation(ElementPosition.CENTER);
    return "UIATarget.localTarget().tap({'x':" + location.getX() + ",'y':" + location.getY() + "});";
  }
View Full Code Here


      y = screenSize.getHeight();
    } else {
      y = point.getY();
    }

    return new Point(x, y);
  }
View Full Code Here

    return new Point(x, y);
  }

  public static Point getScreenCenter(Dimension screenSize) {
    return new Point(screenSize.getWidth() / 2, screenSize.getHeight() / 2);
  }
View Full Code Here

  private static Point getCenterPoint(int xCoord, int yCoord, int width, int height) {
    int centerX = xCoord + (width / 2);
    int centerY = yCoord + (height / 2);

    return new Point(centerX, centerY);
  }
View Full Code Here

    return getCenterPoint(x, y, width, height);
  }

  public static Point getCenterPointFromElement(RemoteWebElement element) throws Exception {
    Point location = element.getLocation(RemoteWebElement.ElementPosition.TOP_LEFT);
    Dimension size = element.getSize();
    return getCenterPoint(location.getX(), location.getY(), size.getWidth(), size.getHeight());
  }
View Full Code Here

      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

  public OperaMouse(OperaDriver parent) {
    exec = parent.getScopeServices().getExec();
  }

  public void click(Coordinates where) {
    Point p = getPoint(where, "click");
    exec.mouseAction(p.x, p.y, OperaMouseKeys.LEFT);
  }
View Full Code Here

    Point p = getPoint(where, "click");
    exec.mouseAction(p.x, p.y, OperaMouseKeys.LEFT);
  }

  public void contextClick(Coordinates where) {
    Point p = getPoint(where, "context click");
    exec.mouseAction(p.x, p.y, OperaMouseKeys.RIGHT);
  }
View Full Code Here

    Point p = getPoint(where, "context click");
    exec.mouseAction(p.x, p.y, OperaMouseKeys.RIGHT);
  }

  public void doubleClick(Coordinates where) {
    Point p = getPoint(where, "double click");
    exec.mouseAction(p.x, p.y, 2, OperaMouseKeys.LEFT);
  }
View Full Code Here

   * Triple click is an Opera specific way of selecting a sentence.
   *
   * @param where to click
   */
  public void tripleClick(Coordinates where) {
    Point p = getPoint(where, "triple click");
    exec.mouseAction(p.x, p.y, 3, OperaMouseKeys.LEFT);
  }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.Point

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.