Examples of sendKeys()


Examples of org.openqa.selenium.WebElement.sendKeys()

        WebElement tf2 = textFields.get(1);

        String firstText = "This is";
        String secondText = " default value";

        tf2.sendKeys(firstText);
        tf1.sendKeys(initialText);
        new Actions(getDriver()).moveToElement(tf2).click().build().perform();

        WebElement activeElement = getFocusedElement();
        Assert.assertEquals("input", activeElement.getTagName());
View Full Code Here

Examples of org.openqa.selenium.WebElement.sendKeys()

    public void testClosePopupRetainText() throws Exception {
        openTestURL();

        ComboBoxElement cb = $(ComboBoxElement.class).first();
        WebElement textbox = cb.findElement(By.vaadin("#textbox"));
        textbox.sendKeys("I");
        cb.openPopup();
        cb.openPopup(); // openPopup() actually toggles
        // The entered value should remain
        assertEquals("I", textbox.getAttribute("value"));
    }
View Full Code Here

Examples of org.openqa.selenium.WebElement.sendKeys()

        openTestURL();
        ComboBoxElement cb = $(ComboBoxElement.class).first();
        cb.selectByText("Item 3");
        WebElement textbox = cb.findElement(By.vaadin("#textbox"));
        textbox.clear();
        textbox.sendKeys("I");
        cb.openPopup();
        // Entered value should remain in the text field even though the popup
        // is opened
        assertEquals("I", textbox.getAttribute("value"));
View Full Code Here

Examples of org.openqa.selenium.WebElement.sendKeys()

        WebElement element = $(ComboBoxElement.class).first().findElement(
                By.vaadin("#textbox"));
        ((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 {
View Full Code Here

Examples of org.openqa.selenium.WebElement.sendKeys()

        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);
        }

        assertEquals("", element.getAttribute("value"));
    }
}
View Full Code Here

Examples of org.openqa.selenium.WebElement.sendKeys()

    public void testSuggestionsPageLength0() {
        openTestURL();

        WebElement textboxPageLength0 = $(ComboBoxElement.class).first()
                .findElement(By.tagName("input"));
        textboxPageLength0.sendKeys("c");
        assertSuggestions("abc", "cde");
    }

    @Test
    public void testSuggestionsPageLength2() {
View Full Code Here

Examples of org.openqa.selenium.WebElement.sendKeys()

    public void testSuggestionsPageLength2() {
        openTestURL();

        WebElement textboxPageLength2 = $(ComboBoxElement.class).get(1)
                .findElement(By.tagName("input"));
        textboxPageLength2.sendKeys("e");
        assertSuggestions("cde", "efg");
    }

    private void assertSuggestions(String... expected) {
        assertEquals(Arrays.asList(expected), getSuggestionsOnScreen());
View Full Code Here

Examples of org.openqa.selenium.WebElement.sendKeys()

                By.id(TreeScrollingOnRightClick.TREE_ID));
        tree.click();

        // Move selection down 50 items
        for (int down = 0; down < 50; down++) {
            tree.sendKeys(Keys.ARROW_DOWN);
        }

        Thread.sleep(1000);

        // Get location of item 40
View Full Code Here

Examples of org.openqa.selenium.interactions.Actions.sendKeys()

        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();
View Full Code Here

Examples of org.openqa.selenium.interactions.Actions.sendKeys()

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