Package org.openqa.selenium.interactions

Examples of org.openqa.selenium.interactions.Action


    }

    private void selectItem(final WebElement item) {
        new Actions(driver)
            .keyDown(Keys.CONTROL).click(item).keyUp(Keys.CONTROL)
            .addAction(new Action() {
                @Override
                public void perform() {
                    Graphene.waitGui().until().element(item).attribute("class").contains(OrderingListInPickList.SELECTED_ITEM_CLASS);
                }
            })
View Full Code Here


        super.sendKeys(element, keysToSend);
        return this;
    }

    public Actions triggerEventByJS(final Event event, final WebElement element) {
        return addAction(new Action() {
            @Override
            public void perform() {
                Graphene.waitGui().until().element(element).is().present();
                Utils.triggerJQ(event.getEventName(), element);
            }
View Full Code Here

  @RunAsClient
  @Test
  public void ClientSideClick(){
    browser.get(deploymentUrl.toExternalForm());

    Action click = builder.moveToElement(chartCanvas,
        chtestjs.pointXPos("frm:chart", 0, 0),
        chtestjs.pointYPos("frm:chart", 0, 0))
        .click().build();

    click.perform();

    //crop decimal places
    double xVal = chtestjs.pointX("frm:chart", 0, 0);
    int xValInt = (int) xVal;
View Full Code Here

        if (this.getBrowserType() == BrowserType.IPAD) {
            yOffsetByDevice = yOffset * 2;
        }
        if (driver instanceof HasTouchScreen) {
            Action flick = (new TouchActions(driver)).flick(element, xOffset, yOffsetByDevice, speed).build();
            flick.perform();
        } else {
            Action flick = (new Actions(driver)).dragAndDropBy(element, xOffset, yOffsetByDevice).build();
            flick.perform();
        }
    }
View Full Code Here

        if (this.getBrowserType() == BrowserType.IPAD) {
            yOffsetByDevice = yOffset * 2;
        }

        Action flick = (new TouchActions(driver)).flick(xOffset, yOffsetByDevice).build();
        flick.perform();
    }
View Full Code Here

        // 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
        Warp.initiate(new Activity() {
            @Override
            public void perform() {
                dragAndDrop.perform();
            }
        }).inspect(new Inspection() {
            private static final long serialVersionUID = 1L;

            @Inject
View Full Code Here

        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

    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

    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

        Assert.assertEquals("Shadow height", "200px", shadow.getCssValue("height"));

        WebElement resizeHandle = browser.findElement(By.id("myForm:popupResizerSE"));
        Actions builder = new Actions(browser);

        final Action dragAndDrop = builder.dragAndDropBy(resizeHandle, 40, 40).build();
        dragAndDrop.perform();

        Assert.assertEquals("Container width", "340px", container.getCssValue("width"));
        Assert.assertEquals("Shadow width", "340px", shadow.getCssValue("width"));
        Assert.assertEquals("Container height", "240px", container.getCssValue("height"));
        Assert.assertEquals("Shadow height", "240px", shadow.getCssValue("height"));
View Full Code Here

TOP

Related Classes of org.openqa.selenium.interactions.Action

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.