Package org.openqa.selenium.interactions

Examples of org.openqa.selenium.interactions.Actions


            .attribute("class").not().contains(advanced().getStyleClassForSelectedRow());
    }

    private void clickOnRow(int rowIndex, Keys... keys) {
        checkSelectRowArguments(rowIndex, keys);
        Actions builder = new Actions(browser);
        for (Keys key : keys) {
            builder.keyDown(key).build().perform();
        }
        advanced().getCellElement(0, rowIndex).click();
        for (Keys key : keys) {
            builder.keyUp(key).build().perform();
        }
    }
View Full Code Here


        public boolean isVisible() {
            return Utils.isVisible(getRootElement());
        }

        public AdvancedPopupPanelInteractions moveByOffset(int xOffset, int yOffset) {
            new Actions(driver).dragAndDropBy(getHeaderElement(), xOffset, yOffset).perform();
            return this;
        }
View Full Code Here

            new Actions(driver).dragAndDropBy(getHeaderElement(), xOffset, yOffset).perform();
            return this;
        }

        public AdvancedPopupPanelInteractions resizeFromLocation(ResizerLocation location, int byXPixels, int byYPixels) {
            new Actions(driver).dragAndDropBy(getResizerElement(location), byXPixels, byYPixels).perform();
            return this;
        }
View Full Code Here

        // given
        browser.get(contextPath.toExternalForm() + "dnd.jsf");
       
        WebElement framework = browser.findElements(By.cssSelector(".ui-draggable")).get(0);

        Actions builder = new Actions(browser);
        final Action dragAndDrop = builder.dragAndDrop(framework, phpTarget).build();
        guardAjax(dragAndDrop).perform();

        Assert.assertEquals(1, phpTarget.findElements(By.cssSelector("td")).size());
    }
View Full Code Here

    @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

        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

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

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

        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

    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

TOP

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

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.