Package org.openqa.selenium.interactions

Examples of org.openqa.selenium.interactions.Action


    return new TouchActions(driver);
  }

  private void singleTapOnElement(String elementId) {
    WebElement toSingleTap = driver.findElement(By.id(elementId));
    Action singleTap = getBuilder(driver).singleTap(toSingleTap).build();
    singleTap.perform();
  }
View Full Code Here


    WebElement link = driver.findElement(By.id("link1"));
    int originalX = link.getLocation().x;
    // The element is located at the right of the page,
    // so it is not initially visible on the screen.
    int dx = -100;
    Action flick = getBuilder(driver).flick(toFlick, dx, 0, speedNormal(dx)).build();
    flick.perform();

    int newX = link.getLocation().x;
    // After flicking, the element should now be visible on the screen.
    assertTrue(newX < originalX, "Expected x < " + originalX + ", but got x = " + newX);
  }
View Full Code Here

    WebElement link = driver.findElement(By.id("link2"));
    int originalX = link.getLocation().x;
    // The element is located at the right of the page,
    // so it is not initially visible on the screen.
    int dx = -100;
    Action flick = getBuilder(driver).flick(toFlick, dx, 0, speedFast(dx)).build();
    flick.perform();
    int newX = link.getLocation().x;
    // After flicking, the element should now be visible on the screen.
    assertTrue(newX < originalX, "Expected x < " + originalX + ", but got x = " + newX);
  }
View Full Code Here

    WebElement link = driver.findElement(By.id("link1"));
    int originalX = link.getLocation().x;
    // The element is located at the right of the page,
    // so it is not initially visible on the screen.
    Action flick = getBuilder(driver).flick(-1000, 0).build();
    flick.perform();
    int newX = link.getLocation().x;
    // After flicking, the element should now be visible on the screen.
    assertTrue(newX < originalX, "Expected x < " + originalX + ", but got x = " + newX);
  }
View Full Code Here

    WebElement link = driver.findElement(By.id("link2"));
    int originalX = link.getLocation().x;
    // The element is located at the right of the page,
    // so it is not initially visible on the screen.
    Action flick = getBuilder(driver).flick(-1500, 0).build();
    flick.perform();
    int newX = link.getLocation().x;
    // After flicking, the element should now be visible on the screen.
    assertTrue(newX < originalX, "Expected x < " + originalX + ", but got x = " + newX);
  }
View Full Code Here

    int originalY = link.getLocation().y;
    // The element is located at the bottom of the page,
    // so it is not initially visible on the screen.
    WebElement toFlick = driver.findElement(By.id("imagestart"));
    int dy = -100;
    Action flick = getBuilder(driver).flick(toFlick, 0, dy, speedNormal(dy)).build();
    flick.perform();
    int newY = link.getLocation().y;
    // After flicking, the element should now be visible on the screen.
    assertTrue(newY < originalY, "Expected y < " + originalY + ", but got y = " + newY);
  }
View Full Code Here

    int originalY = link.getLocation().y;
    // The element is located at the bottom of the page,
    // so it is not initially visible on the screen.
    WebElement toFlick = driver.findElement(By.id("imagestart"));
    int dy = -100;
    Action flick = getBuilder(driver).flick(toFlick, 0, dy, speedFast(dy)).build();
    flick.perform();
    int newY = link.getLocation().y;
    // After flicking, the element should now be visible on the screen.
    assertTrue(newY < originalY, "Expected y < " + originalY + ", but got y = " + newY);
  }
View Full Code Here

    WebElement link = driver.findElement(By.id("link3"));
    int originalY = link.getLocation().y;
    // The element is located at the bottom of the page,
    // so it is not initially visible on the screen.
    Action flick = getBuilder(driver).flick(0, -1500).build();
    flick.perform();
    int newY = link.getLocation().y;

    // After flicking, the element should now be visible on the screen.
    assertTrue(newY < originalY, "Expected y < " + originalY + ", but got y = " + newY);
  }
View Full Code Here

    WebElement link = driver.findElement(By.id("link4"));
    int originalY = link.getLocation().y;
    // The element is located at the bottom of the page,
    // so it is not initially visible on the screen.
    Action flick = getBuilder(driver).flick(0, -1500).build();
    flick.perform();
    int newY = link.getLocation().y;
    // After flicking, the element should now be visible on the screen.
    assertTrue(newY < originalY, "Expected y < " + originalY + ", but got y = " + newY);
  }
View Full Code Here

    return new TouchActions(driver);
  }

  private void doubleTapOnElement(String elementId) {
    WebElement toDoubleTap = driver.findElement(By.id(elementId));
    Action doubleTap = getBuilder(driver).doubleTap(toDoubleTap).build();
    doubleTap.perform();
  }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.interactions.Action

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.