Package org.openqa.selenium.interactions

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


    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

  }

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

  @Test
  public void testCanDoubleTapOnAnImageAndAlterLocationOfElementsInScreen() {
    driver.get(pages.longContentPage);
View Full Code Here

    Action click = builder.moveToElement(chartCanvas,
        chtestjs.pointXPos("frm:chart", 0, 0),
        chtestjs.pointYPos("frm:chart", 0, 0))
        .click().build();

    click.perform();

    //crop decimal places
    double xVal = chtestjs.pointX("frm:chart", 0, 0);
    int xValInt = (int) xVal;
View Full Code Here

        if (this.getBrowserType() == BrowserType.IPAD) {
            yOffsetByDevice = yOffset * 2;
        }
        if (driver instanceof HasTouchScreen) {
            Action flick = (new TouchActions(driver)).flick(element, xOffset, yOffsetByDevice, speed).build();
            flick.perform();
        } else {
            Action flick = (new Actions(driver)).dragAndDropBy(element, xOffset, yOffsetByDevice).build();
            flick.perform();
        }
    }
View Full Code Here

        if (driver instanceof HasTouchScreen) {
            Action flick = (new TouchActions(driver)).flick(element, xOffset, yOffsetByDevice, speed).build();
            flick.perform();
        } else {
            Action flick = (new Actions(driver)).dragAndDropBy(element, xOffset, yOffsetByDevice).build();
            flick.perform();
        }
    }

    public void flick(int xOffset, int yOffset) {
        WebDriver driver = getDriver();
View Full Code Here

        if (this.getBrowserType() == BrowserType.IPAD) {
            yOffsetByDevice = yOffset * 2;
        }

        Action flick = (new TouchActions(driver)).flick(xOffset, yOffsetByDevice).build();
        flick.perform();
    }

    /*
     * Waits for the "loading" and spinner to disappear
     */
 
View Full Code Here

        // when / then
        Warp.initiate(new Activity() {
            @Override
            public void perform() {
                dragAndDrop.perform();
            }
        }).inspect(new Inspection() {
            private static final long serialVersionUID = 1L;

            @Inject
View Full Code Here

        browser.get(contextPath.toExternalForm());
        WebElement column1ResizeHandle = header.findElement(By.cssSelector(".rf-edt-hdr .rf-edt-td-column1 .rf-edt-rsz"));

        Actions builder = new Actions(browser);
        final Action dragAndDrop = builder.dragAndDropBy(column1ResizeHandle, -20, 0).build();
        dragAndDrop.perform();

        Assert.assertEquals("181px", firstRow.findElement(By.cssSelector("td")).getCssValue("width"));
        Assert.assertEquals("180px", firstRow.findElement(By.cssSelector("td .rf-edt-c-column1")).getCssValue("width"));
    }
View Full Code Here

        browser.get(contextPath.toExternalForm());
        WebElement column1ResizeHandle = header.findElement(By.cssSelector(".rf-edt-hdr .rf-edt-td-column1 .rf-edt-rsz"));

        Actions builder = new Actions(browser);
        final Action dragAndDrop = builder.dragAndDropBy(column1ResizeHandle, 20, 0).build();
        dragAndDrop.perform();

        Assert.assertEquals("221px", firstRow.findElement(By.cssSelector("td")).getCssValue("width"));
        Assert.assertEquals("220px", firstRow.findElement(By.cssSelector("td .rf-edt-c-column1")).getCssValue("width"));
    }
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.