Package org.openqa.selenium.interactions

Examples of org.openqa.selenium.interactions.Actions


    //There's no point fixing this test before #7309 is actually fixed.
    public void pageIsNotScrolled() throws IOException {
        openTestURL();

        new Actions(driver).sendKeys(Keys.PAGE_DOWN).perform();

        $(TableElement.class).first().getCell(2, 0).click();

        compareScreen("scrolledDown");
    }
View Full Code Here


    public void textAreaShiftEnterEventPropagation()
            throws InterruptedException {
        openTestURL();

        WebElement textArea = $(TextAreaElement.class).first();
        Actions builder = new Actions(driver);
        builder.click(textArea);
        builder.sendKeys(textArea, "first line asdf");
        builder.keyDown(Keys.SHIFT);
        builder.sendKeys(Keys.ENTER);
        builder.keyUp(Keys.SHIFT);
        builder.sendKeys(textArea, "second line jkl;");
        builder.perform();

        // Should have triggered shortcut
        Assert.assertEquals("1. Shift-Enter button pressed", getLogRow(0));
    }
View Full Code Here

    @Test
    public void textAreaCtrlEnterEventPropagation() throws InterruptedException {
        openTestURL();

        WebElement textArea = $(TextAreaElement.class).first();
        Actions builder = new Actions(driver);
        builder.click(textArea);
        builder.sendKeys(textArea, "first line asdf");
        builder.keyDown(Keys.CONTROL);
        builder.sendKeys(Keys.ENTER);
        builder.keyUp(Keys.CONTROL);
        builder.sendKeys(textArea, "second line jkl;");
        builder.perform();

        // Should have triggered shortcut
        Assert.assertEquals("1. Ctrl-Enter button pressed", getLogRow(0));
    }
View Full Code Here

        ((TestBenchElementCommands) element).click(8, 7);
        element.clear();
        element.sendKeys("New value");
        assertEquals("New value", element.getAttribute("value"));
        if (BrowserUtil.isPhantomJS(getDesiredCapabilities())) {
            new Actions(getDriver()).sendKeys(Keys.ENTER).perform();
            Thread.sleep(500);
        } else {
            element.sendKeys(Keys.RETURN);
        }
View Full Code Here

        ButtonElement buttonCaption = $(ButtonElement.class).first();
        return buttonCaption.getText();
    }

    private void sendKey(Keys key) {
        new Actions(getDriver()).sendKeys(key).perform();
    }
View Full Code Here

        WebElement comboBox = vaadinElement("/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VFilterSelect[0]#textbox");

        // navigate to the next page. keyboard navigation is the preferred
        // method here since it's much easier to implement.

        Actions keyNavigation = new Actions(driver).moveToElement(comboBox)
                .click();

        for (int i = 0; i < 25; ++i) {
            keyNavigation.sendKeys(Keys.ARROW_DOWN);

        }
        keyNavigation.perform();

        // The broken behavior always caused a v-shadow element to have
        // height: 10px. Verify that this does no longer happen.

        String cssValue = driver.findElement(By.className("v-shadow"))
View Full Code Here

    private void assertLastLogRowIs(String expected) {
        assertThat(getLogRow(0), is(expected));
    }

    private void sendEnter(AbstractComponentElement target) {
        new Actions(getDriver()).click(target).sendKeys(Keys.ENTER).perform();
    }
View Full Code Here

        // Get location of item 40
        Point item40Location = getTreeNode("Node 40").getLocation();

        // Right click on item 45
        WebElement item45 = getTreeNode("Node 45");
        new Actions(getDriver()).moveToElement(item45).contextClick(item45)
                .perform();

        // Ensure location of item 40 is still the same (no scrolling)
        Point item40Location2 = getTreeNode("Node 40").getLocation();
        assertEquals(item40Location.getY(), item40Location2.getY());
View Full Code Here

                By.className("v-filterselect-input"));
        cb.click();
    }

    private void typeString(String s) {
        Actions action = new Actions(getDriver());
        action.sendKeys(s);
        action.build().perform();
    }
View Full Code Here

    public void testPopup() throws IOException {
        openTestURL();

        WebElement button = driver.findElement(By
                .className("v-datefield-button"));
        new Actions(driver).moveToElement(button).click()
                .sendKeys(Keys.ARROW_DOWN).perform();

        Assert.assertFalse(
                "Calendar popup should not be opened for disabled date field",
                isElementPresent(By.className("v-datefield-popup")));
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.