Package org.openqa.selenium

Examples of org.openqa.selenium.Point


    return StringUtils.EMPTY;
  }

  public Point getLocation() {
    if(is_not_null(_webElement)) {
      Point value = _webElement.getLocation();
      info("Element '" + super.name() + "' - Location is '" + value + "'");
      return value;
    } else {
      info("Element '" + super.name() + "' - has a null _webelement, cannot do getLocation()");
    }
    return new Point(0, 0);
  }
View Full Code Here


   * NOTE: This method is still under development.
   * @return
   */
  public String static_info() {
    String info = "";
    Point point = getLocation();
    info += "X = " + point.getX();
    info += ", Y = " + point.getY();
    Dimension dimension = getSize();
    info += ", Height = " + dimension.getHeight();
    info += ", Width = " + dimension.getWidth();
    return info;
  }
View Full Code Here

//    return elements;
//  }
 
  public void move_by(int x, int y) {
    takeScreenshot();
    Point current_location = getLocation();
    action("Current position of element '" + current_location + "', Moving by (x, y) = (" + x + ", " + y + ")");
   
    Actions drag = new Actions(browser.driver());
    try {
      drag.dragAndDropBy(_nativeWebElement(), x, y).build().perform();
      Point new_location = getLocation();
      action("New position of element '" + new_location + "', Moved by (x, y) = (" + x + ", " + y + ")");
    } catch (org.openqa.selenium.interactions.MoveTargetOutOfBoundsException mtoobe) {
      error("Cannot move element '" + current_location + "', to (x, y) = (" + x + ", " + y + "), got org.openqa.selenium.interactions.MoveTargetOutOfBoundsException");
    }
   
View Full Code Here

    takeScreenshot();
  }
 
  public void move_to(int x, int y) {
    takeScreenshot();
    Point current_location = getLocation();
    int offset_x = x - current_location.getX();
    int offset_y = y - current_location.getY();
   
    action("Current position of element '" + current_location + "', Moving to (x, y) = (" + x + ", " + y + ")");
    Actions drag = new Actions(browser.driver());
    try {
      drag.dragAndDropBy(_nativeWebElement(), offset_x, offset_y).build().perform();
      Point new_location = getLocation();
      action("New position of element '" + new_location + "', Moved to (x, y) = (" + x + ", " + y + ")");
    } catch (org.openqa.selenium.interactions.MoveTargetOutOfBoundsException mtoobe) {
      error("Cannot move element '" + current_location + "', to (x, y) = (" + x + ", " + y + "), got org.openqa.selenium.interactions.MoveTargetOutOfBoundsException");
    }
   
View Full Code Here

    return StringUtils.EMPTY;
  }

  public Point getLocation() {
    if(is_not_null(_webElement)) {
      Point value = _webElement.getLocation();
      info("Element '" + super.name() + "' - Location is '" + value + "'");
      return value;
    } else {
      info("Element '" + super.name() + "' - has a null _webelement, cannot do getLocation()");
    }
    return new Point(0, 0);
  }
View Full Code Here

    }
    // put in map
    if (!stateCandidatesMap.containsKey(state.getName())) {
      stateCandidatesMap.put(state.getName(), new ArrayList<RenderedCandidateElement>());
    }
    Point location = webElement.getLocation();
    Dimension size = webElement.getSize();
    RenderedCandidateElement renderedCandidateElement =
    // TODO Check if element.getIdentification().getValue() is correct replacement for
    // element.getXpath()
            new RenderedCandidateElement(element.getElement(), element.getIdentification()
View Full Code Here

   * NOTE: This method is still under development.
   * @return
   */
  public String static_info() {
    String info = "";
    Point point = getLocation();
    info += "X = " + point.getX();
    info += ", Y = " + point.getY();
    Dimension dimension = getSize();
    info += ", Height = " + dimension.getHeight();
    info += ", Width = " + dimension.getWidth();
    return info;
  }
View Full Code Here

    return elements;
  }
 
  public void move_by(int x, int y) {
    takeScreenshot();
    Point current_location = getLocation();
    action("Current position of element '" + current_location + "', Moving by (x, y) = (" + x + ", " + y + ")");
   
    Actions drag = new Actions(browser.driver());
    try {
      drag.dragAndDropBy(_nativeWebElement(), x, y).build().perform();
      Point new_location = getLocation();
      action("New position of element '" + new_location + "', Moved by (x, y) = (" + x + ", " + y + ")");
    } catch (org.openqa.selenium.interactions.MoveTargetOutOfBoundsException mtoobe) {
      error("Cannot move element '" + current_location + "', to (x, y) = (" + x + ", " + y + "), got org.openqa.selenium.interactions.MoveTargetOutOfBoundsException");
    }
   
View Full Code Here

    takeScreenshot();
  }
 
  public void move_to(int x, int y) {
    takeScreenshot();
    Point current_location = getLocation();
    int offset_x = x - current_location.getX();
    int offset_y = y - current_location.getY();
   
    action("Current position of element '" + current_location + "', Moving to (x, y) = (" + x + ", " + y + ")");
    Actions drag = new Actions(browser.driver());
    try {
      drag.dragAndDropBy(_nativeWebElement(), offset_x, offset_y).build().perform();
      Point new_location = getLocation();
      action("New position of element '" + new_location + "', Moved to (x, y) = (" + x + ", " + y + ")");
    } catch (org.openqa.selenium.interactions.MoveTargetOutOfBoundsException mtoobe) {
      error("Cannot move element '" + current_location + "', to (x, y) = (" + x + ", " + y + "), got org.openqa.selenium.interactions.MoveTargetOutOfBoundsException");
    }
   
View Full Code Here

    return StringUtils.EMPTY;
  }

  public Point getLocation() {
    if(is_not_null(_webElement)) {
      Point value = _webElement.getLocation();
      info("Element '" + super.name() + "' - Location is '" + value + "'");
      return value;
    } else {
      info("Element '" + super.name() + "' - has a null _webelement, cannot do getLocation()");
    }
    return new Point(0, 0);
  }
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.