Examples of Actions


Examples of org.openqa.selenium.interactions.Actions

    @Test
    public void testSelectionRangeDragging() throws IOException {
        openTestURL();
        clickRow(3);
        new Actions(driver).keyDown(Keys.SHIFT).perform();
        clickRow(8);
        new Actions(driver).keyUp(Keys.SHIFT).perform();
        dragRows(5, 700, 0);
        compareScreen("draggedMultipleRows");
        new Actions(driver).release().perform();
    }
View Full Code Here

Examples of org.openqa.selenium.interactions.Actions

        rows.get(index).click();
    }

    private void dragRows(int dragIdx, int xOffset, int yOffset) {
        List<WebElement> rows = getAllRows();
        new Actions(driver).moveToElement(rows.get(dragIdx)).clickAndHold()
                .moveByOffset(5, 0).perform();
        new Actions(driver).moveByOffset(xOffset - 5, yOffset).perform();

    }
View Full Code Here

Examples of org.openqa.selenium.interactions.Actions

        // retrieve plot offset in canvas via JS (coordinates differ based on browser)
        int x = chtestjs.pointXPos("frm:chart", 0, 0);
        int y = chtestjs.pointYPos("frm:chart", 0, 0);

        // onplotclick client side
        new Actions(browser).moveToElement(chartCanvas, x, y).click().build().perform();
        waitAjax(browser).until().element(clickInfo).text().contains(plotClick);

        // onplotclick server side, since the element was already clicked only assertion is needed
        waitAjax(browser).until().element(serverSideInfo).text().contains(serverSide);

        // onplothover, first move away to clear the text from previous events
        new Actions(browser).moveToElement(serverSideInfo).click().build().perform();
        new Actions(browser).moveToElement(chartCanvas, x, y).build().perform();
        waitAjax(browser).until().element(hoverInfo).text().contains(plotHover);
    }
View Full Code Here

Examples of org.openqa.selenium.interactions.Actions

        // get plot coordinates on screen before zooming
        int xBeforeZoom = chtestjs.pointXPos("frm:chart", 0, 0);

        // zoom some area
        new Actions(browser)
            .moveToElement(chartCanvas, chtestjs.pointXPos("frm:chart", 1, 1), chtestjs.pointYPos("frm:chart", 1, 1))
            .clickAndHold()
            .moveToElement(chartCanvas, chtestjs.pointXPos("frm:chart", 2, 2), chtestjs.pointYPos("frm:chart", 2, 2)).release()
            .build().perform();
        // new Actions(browser).clickAndHold().moveByOffset(200, 50).release().build().perform();
View Full Code Here

Examples of org.openqa.selenium.interactions.Actions

        List<WebElement> rows = getVisibleTableRows();
        shiftClickElement(rows.get(rows.size() - 1));
    }

    protected void shiftClickElement(WebElement element) {
        new Actions(getDriver()).keyDown(Keys.SHIFT).click(element)
                .keyUp(Keys.SHIFT).perform();
    }
View Full Code Here

Examples of org.openqa.selenium.interactions.Actions

    public void table_width_resize() throws InterruptedException {
        // given
        browser.get(contextPath.toExternalForm() + "width.jsf");
        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, 60, 0).build();

        // when / then
        Warp.initiate(new Activity() {
            @Override
            public void perform() {
View Full Code Here

Examples of org.openqa.selenium.interactions.Actions

        // given
        browser.get(contextPath.toExternalForm());
        WebElement column1 = header.findElement(By.cssSelector(".rf-edt-hdr-c.rf-edt-c-column1"));
        WebElement column3 = header.findElement(By.cssSelector(".rf-edt-c-column3 .rf-edt-hdr-c-cnt"));

        Actions builder = new Actions(browser);

        final Action dragAndDrop = builder.clickAndHold(column3)
            .moveToElement(column1)
            .release(column1)
            .build();

        // when / then
View Full Code Here

Examples of org.openqa.selenium.interactions.Actions

    @Test
    public void column_resize_smaller() {
        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

Examples of org.openqa.selenium.interactions.Actions

    @Test
    public void column_resize_bigger() {
        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

Examples of org.openqa.selenium.interactions.Actions

        assertEquals("0-100px",
                $(".v-csslayout-grid.second").getAttribute("width-range"));
    }

    private void moveSplitter(int xOffset) {
        new Actions(getDriver()).clickAndHold($(".v-splitpanel-hsplitter"))
                .moveByOffset(xOffset, 0).release().build().perform();
    }
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.