Package org.openqa.selenium.interactions

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


    @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

    @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

        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

        compareScreen("stacked");

        WebElement window4 = driver.findElement(By
                .xpath("//*[contains(text(), 'Window 4')]"));
        new Actions(driver).moveToElement(window4, 1, 9).click().perform();

        compareScreen("win4-on-top");
    }
View Full Code Here

     * Tests that backspace action outside textfield is prevented
     */
    @Test
    public void testWithFocusOnModal() throws Exception {
        // Try to send back actions to the browser.
        new Actions(getDriver()).sendKeys(BACK_SPACE).perform();

        checkButtonsCount();
    }
View Full Code Here

        // tab in last field set focus on bottom component
        textField.sendKeys(TAB);

        // Try to send back actions to the browser.
        new Actions(getDriver()).sendKeys(BACK_SPACE).perform();

        checkButtonsCount();
    }
View Full Code Here

        browsers.remove(Browser.IE8.getDesiredCapabilities());
        return browsers;
    }

    private WebElement openContextMenu() {
        Actions actions = new Actions(getDriver());
        actions.contextClick(findElement(By.className("v-table-cell-wrapper")));
        actions.perform();
        return findElement(By.className("v-contextmenu"));
    }
View Full Code Here

        actions.perform();
        return findElement(By.className("v-contextmenu"));
    }

    private void closeContextMenu() {
        Actions actions = new Actions(getDriver());
        actions.click().build().perform();
    }
View Full Code Here

    @Test
    public void testTextAreaDndImage() {
        openTestURL();

        WebElement wrapper = driver.findElement(By.className("v-ddwrapper"));
        Actions actions = new Actions(driver);
        actions.click(wrapper);
        actions.perform();

        WebElement focusedElement = driver.findElement(By
                .className("v-textarea-focus"));
        Assert.assertNotNull("Text area did not obtain focus after click",
                focusedElement);
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.