Answers for "How to scroll in appium using java"

1

How to scroll in appium using java

public void scrollDown()  {

    //The viewing size of the device
    Dimension size = driver.manage().window().getSize();

    //x position set to mid-screen horizontally
    int width = size.width / 2;

    //Starting y location set to 80% of the height (near bottom)
    int startPoint = (int) (size.getHeight() * 0.80);

    //Ending y location set to 20% of the height (near top)
    int endPoint = (int) (size.getHeight() * 0.20);

    new TouchAction(driver).press(PointOption.point(width, startPoint)).waitAction(WaitOptions.waitOptions(Duration.ofMillis(2000))).moveTo(PointOption.point(width, endPoint)).release().perform();

}
Posted by: Guest on March-10-2021

Code answers related to "How to scroll in appium using java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language