Package org.openqa.selenium

Examples of org.openqa.selenium.WebElement


    /**
     * workaround for http://dev.vaadin.com/ticket/13763
     */
    private void check(String caption) {
        WebElement cb = $(CheckBoxElement.class).caption(caption).first()
                .findElement(By.xpath("input"));
        if (BrowserUtil.isChrome(getDesiredCapabilities())) {
            testBenchElement(cb).click(0, 0);
        } else {
            cb.click();
        }
    }
View Full Code Here


    @Test
    public void testLeftColumnAlignment() throws Exception {
        openTestURL();

        // Do align columns to the left
        WebElement webElement = driver.findElement(By.className("v-button"));
        webElement.click();

        Assert.assertTrue("Table caption is not aligned to the left",
                isElementPresent(By
                        .className("v-table-caption-container-align-left")));

        WebElement footer = driver.findElement(By
                .className("v-table-footer-container"));

        Assert.assertEquals("Table footer is not aligned to the left", "left",
                footer.getCssValue("text-align"));

        WebElement cell = driver.findElement(By
                .className("v-table-cell-wrapper"));

        Assert.assertEquals("Table cell is not aligned to the left", "left",
                cell.getCssValue("text-align"));
    }
View Full Code Here

        new Actions(driver).moveByOffset(xOffset - 5, yOffset).perform();

    }

    private List<WebElement> getAllRows() {
        WebElement table = vaadinElement("/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]");
        return table.findElements(By.cssSelector(".v-table-table tr"));

    }
View Full Code Here

    @Test
    public void msg_after_clicking_h_command_button() throws InterruptedException {
        // given
        browser.get(contextPath.toExternalForm());
        WebElement input = browser.findElement(By.id("myForm:input2"));
        WebElement button = browser.findElement(By.id("myForm:hButton"));

        input.sendKeys("RichFaces");
        Graphene.guardHttp(button).click();

        WebElement message = browser.findElement(By.id("myForm:msg2"));
        Assert.assertEquals("Validation message", "Input 2: max 4 characters", message.getText());
    }
View Full Code Here

    @Test
    public void msg_after_clicking_r_command_button() throws InterruptedException {
        // given
        browser.get(contextPath.toExternalForm());
        WebElement input = browser.findElement(By.id("myForm:input2"));
        WebElement button = browser.findElement(By.id("myForm:rButton"));

        input.sendKeys("RichFaces");
        Graphene.guardAjax(button).click();

        WebElement message = browser.findElement(By.id("myForm:msg2"));
        Assert.assertEquals("Validation message", "Input 2: max 4 characters", message.getText());
    }
View Full Code Here

    @Test
    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
View Full Code Here

    @Test
    @Ignore("RF-12814")
    public void table_order_server_side() throws InterruptedException {
        // 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)
View Full Code Here

    @Test
    public void table_sort() throws InterruptedException {
        // given
        browser.get(contextPath.toExternalForm() + "sort.jsf");
        WebElement cell = browser.findElement(ByJQuery.selector(".rf-edt-c-column2 .rf-edt-c-cnt:first"));
        Assert.assertEquals("9", cell.getText());

        guardAjax(sortLink).click();
        Graphene.waitAjax().until().element(browser.findElement(ByJQuery.selector(".rf-edt-c-column2 .rf-edt-c-cnt:first"))).text().equalTo("0");

        // when / then
View Full Code Here

    @Test
    public void table_observe() throws InterruptedException {
        // given
        browser.get(contextPath.toExternalForm() + "filter.jsf");

        WebElement cell = browser.findElement(ByJQuery.selector(".rf-edt-c-column2 .rf-edt-c-cnt:last"));
        Assert.assertEquals("6", cell.getText());

        WebElement filterInput = browser.findElement(By.id("myForm:edt:filterInput"));
        filterInput.clear();
        filterInput.sendKeys("3");
        guardAjax(filterInput).sendKeys(Keys.TAB);
        Graphene.waitAjax().until().element(ByJQuery.selector(".rf-edt-c-column2 .rf-edt-c-cnt:last")).text().equalTo("3");

        // when / then
        Warp.initiate(new Activity() {
View Full Code Here

    // Scrolls table element
    // Method scroll in TalbeElement class has a bug
    //
    private void scrollTable(TableElement tbl, int value) {
        WebElement actualElement = tbl.findElement(By
                .className("v-table-body-wrapper"));
        JavascriptExecutor js = tbl.getCommandExecutor();
        js.executeScript("arguments[0].scrollTop = " + value, actualElement);
    }
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.