Package org.openqa.selenium

Examples of org.openqa.selenium.WebElement


        autocompleteInput.sendKeys("Y");
        waitGui().until().element(suggestionList).is().visible();
        //Still only New York should be shown
        assertEquals(1, autocompleteItems.size());      
        //Choose New York from list
        WebElement firstItem = autocompleteItems.get(0);
        actions.moveToElement(firstItem).perform();
        //Add token an write T
        autocompleteInput.sendKeys(token+"T");
        waitGui().until().element(suggestionList).is().visible();  
        //There should be displayed only two options Toronto and Tamba Bay
View Full Code Here


        // given
        browser.get(contextPath.toExternalForm());

        browser.findElements(By.className("rf-edt-flt-i"));

        WebElement tableHeader = browser.findElement(By.className("rf-edt-hdr"));
        List<WebElement> column2BuiltinFilter = tableHeader.findElements(By.cssSelector(".rf-edt-c-column2 .rf-edt-flt-i"));
        Assert.assertEquals("Built-in filter for column2 should be present", 1, column2BuiltinFilter.size());
        List<WebElement> column3BuiltinFilter = tableHeader.findElements(By.cssSelector(".rf-edt-c-column3 .rf-edt-flt-i"));
        Assert.assertEquals("Built-in filter for column3 is should not be present", 0, column3BuiltinFilter.size());
    }
View Full Code Here

        browser.findElements(By.className("rf-edt-flt-i"));

        List<WebElement> cells = browser.findElements(By.cssSelector(".rf-edt-c-column2 .rf-edt-c-cnt"));
        Assert.assertEquals("Number of rows present", 10, cells.size());

        final WebElement filterInput = browser.findElement(By.id("myForm:edt:column2:flt"));
        filterInput.clear();
        filterInput.sendKeys("3");
        Warp.initiate(new Activity() {
            @Override
            public void perform() {
                filterInput.sendKeys(Keys.TAB);
            }
        }).inspect(new Inspection() {
            private static final long serialVersionUID = 1L;

            @Inject IterationBuiltInBean iterationBuiltInBean;

            @AfterPhase(Phase.INVOKE_APPLICATION)
            public void verify_bean_filter_cleared() {
                Assert.assertEquals("Backing bean filterValue should be set", 3, (long) iterationBuiltInBean.getFilterValue());
            }
        });

        cells = browser.findElements(By.cssSelector(".rf-edt-c-column2 .rf-edt-c-cnt"));
        Assert.assertEquals("Number of rows present", 4, cells.size());

        Warp.initiate(new Activity() {
            @Override
            public void perform() {
                button.click();
            }
        }).inspect(new Inspection() {
            private static final long serialVersionUID = 1L;

            @Inject IterationBuiltInBean iterationBuiltInBean;

            @AfterPhase(Phase.INVOKE_APPLICATION)
            public void verify_bean_filter_cleared() {
                Assert.assertEquals("Backing bean filterValue should be set", 6, (long) iterationBuiltInBean.getFilterValue());
            }
        });

        cells = browser.findElements(By.cssSelector(".rf-edt-c-column2 .rf-edt-c-cnt"));
        Assert.assertEquals("Number of rows present", 7, cells.size());

        final WebElement filterInput2 = browser.findElement(By.id("myForm:edt:column2:flt"));
        Assert.assertEquals("Filter input value should be backing bean value", "6", filterInput2.getAttribute("value"));
    }
View Full Code Here

        List<WebElement> cells = browser.findElements(By.cssSelector(".rf-edt-c-column2 .rf-edt-c-cnt"));
        Assert.assertEquals("Value of the first cell of the second column", "3", cells.get(0).getText());
        Assert.assertEquals("Number of rows present", 10, cells.size());

        WebElement filterInput = browser.findElement(By.id("myForm:edt:column2:flt"));
        filterInput.clear();
        filterInput.sendKeys("3");
        guardAjax(filterInput).sendKeys(Keys.TAB);
        cells = browser.findElements(By.cssSelector(".rf-edt-c-column2 .rf-edt-c-cnt"));
        Assert.assertEquals("Value of the first cell of the second column", "3", cells.get(0).getText());
        Assert.assertEquals("Number of rows present", 4, cells.size());
    }
View Full Code Here

        waitGui().until().element(suggestionList).is().visible();
        assertEquals(4, autocompleteItems.size());
        assertEquals("t,", autocompleteInput.getAttribute("value"));

        WebElement secondItem = autocompleteItems.get(1);

        actions.moveToElement(secondItem).perform();
        waitGui().until().element(secondItem).attribute("class").contains("rf-au-itm-sel");
        assertTrue(suggestionList.isDisplayed());
        assertEquals(4, autocompleteItems.size());
        assertEquals("t,", autocompleteInput.getAttribute("value"));

        secondItem.click();
        waitGui().until().element(suggestionList).is().not().visible();
        assertEquals("t,New York", autocompleteInput.getAttribute("value"));

        autocompleteInput.sendKeys(", ");
        waitGui().until().element(suggestionList).is().visible();
        assertEquals(4, autocompleteItems.size());
        assertEquals("t,New York, ", autocompleteInput.getAttribute("value"));

        WebElement thirdItem = autocompleteItems.get(2);

        actions.moveToElement(thirdItem).perform();
        waitGui().until().element(thirdItem).attribute("class").contains("rf-au-itm-sel");
        assertTrue(suggestionList.isDisplayed());
        assertEquals(4, autocompleteItems.size());
        assertEquals("t,New York, ", autocompleteInput.getAttribute("value"));

        thirdItem.click();
        waitGui().until().element(suggestionList).is().not().visible();
        assertEquals("t,New York, San Francisco", autocompleteInput.getAttribute("value"));
    }
View Full Code Here

     * {@link https://issues.jboss.org/browse/RF-12969}
     */
    @Test
    public void check_click_active_tab() {
        browser.get(contextPath.toExternalForm() + "index.jsf");
        WebElement activeTab = tabPanel.advanced().getActiveHeaderElement();
        guardAjax(activeTab).click();
        Assert.assertEquals(null, body.getAttribute("JSError"));
    }
View Full Code Here

        waitGui().until().element(suggestionList).is().visible();
        assertEquals(4, autocompleteItems.size());
        assertEquals("t,Toronto", autocompleteInput.getAttribute("value"));

        WebElement secondItem = autocompleteItems.get(1);

        actions.moveToElement(secondItem).perform();
        waitGui().until().element(autocompleteInput).attribute("value").equalTo("t,New York");
        assertTrue(suggestionList.isDisplayed());
        assertEquals(4, autocompleteItems.size());

        secondItem.click();
        waitGui().until().element(suggestionList).is().not().visible();
        assertEquals("t,New York", autocompleteInput.getAttribute("value"));

        actions.moveToElement(autocompleteInput).perform();
        autocompleteInput.sendKeys(", ");
        waitGui().until().element(suggestionList).is().visible();
        assertEquals(4, autocompleteItems.size());
        assertEquals("t,New York, Toronto", autocompleteInput.getAttribute("value"));

        WebElement thirdItem = autocompleteItems.get(2);

        actions.moveToElement(thirdItem).perform();
        waitGui().until().element(autocompleteInput).attribute("value").equalTo("t,New York, San Francisco");
        assertTrue(suggestionList.isDisplayed());
        assertEquals(4, autocompleteItems.size());

        thirdItem.click();
        waitGui().until().element(suggestionList).is().not().visible();
        assertEquals("t,New York, San Francisco", autocompleteInput.getAttribute("value"));
    }
View Full Code Here

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

        WebElement element = getDriver().findElement(
                By.id(ClientRpcClass.TEST_COMPONENT_ID));
        Assert.assertEquals("pause", element.getText());
    }
View Full Code Here

    }

    @Test
    public void comboBoxItemIconsOnKeyboardNavigation() throws Exception {
        openTestURL();
        WebElement comboBoxInput = getDriver().findElement(
                By.className("v-filterselect-input"));

        // No initial value.
        assertEquals("", comboBoxInput.getText());

        // Navigate to the first item with keyboard navigation.
        sendKeys(comboBoxInput, Keys.ARROW_DOWN, Keys.ARROW_DOWN,
                Keys.ARROW_DOWN);

        // Value must be "One" without any extra characters.
        // See ticket #14660
        assertEquals("One", comboBoxInput.getAttribute("value"));

        // Check also the second item.
        sendKeys(comboBoxInput, Keys.ARROW_DOWN);
        assertEquals("Two", comboBoxInput.getAttribute("value"));
    }
View Full Code Here

                .className("v-table-cell-content"));
        int rowWidth = rows.get(0).getSize().getWidth();

        List<WebElement> rowWrappers = findElements(By
                .className("v-table-cell-wrapper"));
        WebElement row = rowWrappers.get(0);

        containerWidth = row.getSize().getWidth();
        assertRowWrapperWidth(containerWidth, rowWidth);

        buttonWidth = row.findElement(By.className("v-button")).getSize()
                .getWidth();
        assertButtonWidth(buttonWidth, containerWidth);

        row = rowWrappers.get(1);
        containerWidth = row.getSize().getWidth();
        assertRowWrapperWidth(containerWidth, rowWidth);

        buttonWidth = row.findElement(By.className("v-nativebutton")).getSize()
                .getWidth();
        assertButtonWidth(buttonWidth, containerWidth);

    }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.WebElement

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.