Example usage for org.openqa.selenium.remote BrowserType IPAD

List of usage examples for org.openqa.selenium.remote BrowserType IPAD

Introduction

In this page you can find the example usage for org.openqa.selenium.remote BrowserType IPAD.

Prototype

String IPAD

To view the source code for org.openqa.selenium.remote BrowserType IPAD.

Click Source Link

Usage

From source file:org.auraframework.test.WebDriverTestCase.java

License:Apache License

public void flick(WebElement element, int xOffset, int yOffset, int speed) {
    WebDriver driver = getDriver();//  ww w  . ja v a  2 s .c o m
    // check for wrapped driver
    if (driver instanceof EventFiringWebDriver) {
        driver = ((EventFiringWebDriver) driver).getWrappedDriver();
    }
    driver = augmentDriver();
    // for iPhone
    int yOffsetByDevice = yOffset;

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

From source file:org.auraframework.test.WebDriverTestCase.java

License:Apache License

public void flick(int xOffset, int yOffset) {
    WebDriver driver = getDriver();/*from   w  w w . j ava  2s.co m*/
    driver = augmentDriver();
    // for iPhone
    int yOffsetByDevice = yOffset;

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

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