Package org.openqa.selenium.interactions

Examples of org.openqa.selenium.interactions.Action.perform()


    // so it is not initially visible on the screen.
    assertTrue(x > 1500, "Expected x > 1500, but got x = " + x);

    WebElement toScroll = driver.findElement(By.id("imagestart"));
    Action scroll = getBuilder(driver).scroll(toScroll, -100, 0).build();
    scroll.perform();

    x = link.getLocation().x;
    // After scrolling, the location of the element should change accordingly.
    assertTrue(x < 1500, "Expected x < 1500, but got x = " + x);
  }
View Full Code Here


    // The element is located at the right of the page,
    // so it is not initially visible on the screen.
    assertTrue(y > 1200);

    Action scrollDown = getBuilder(driver).scroll(0, 800).build();
    scrollDown.perform();

    y = link.getLocation().y;
    // After scrolling, the location of the element should change accordingly.
    assertTrue(y < 3500);
  }
View Full Code Here

    // The element is located at the right of the page,
    // so it is not initially visible on the screen.
    assertTrue(x > 1500, "Expected x > 1500, but got x = " + x);

    Action scrollDown = getBuilder(driver).scroll(400, 0).build();
    scrollDown.perform();

    x = link.getLocation().y;
    // After scrolling, the location of the element should change accordingly.
    assertTrue(x < 1500, "Expected x < 1500, but got x = " + x);
  }
View Full Code Here

  }

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

  @Test
  public void testCanSingleTapOnALinkAndFollowIt() throws InterruptedException {
    driver.get(pages.clicksPage);
View Full Code Here

    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

    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

    // 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

    // 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

TOP
Copyright © 2018 www.massapi.com. 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.