This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
7 / 7
Sep 2018

Currently I use these code to perform swipe down in app but nothing happens. Please help

public void swipingVertical() throws InterruptedException {
    size = driver.manage().window().getSize();

    int starty = (int) (size.height * 0.8);
    int endy = (int) (size.height * 0.2);
    int startx = size.width / 2;

    //Swipe from Bottom to Top.
    new TouchAction(driver).press(PointOption.point(startx, starty)).
            moveTo(PointOption.point(startx, endy)).release().perform();
  • created

    Sep '18
  • last reply

    Sep '18
  • 6

    replies

  • 229

    views

  • 2

    users

  • 1

    like

try the below code.
int width = dim.getWidth() / 2;
int startY = (int) (dim.getHeight() * 0.3);
int endY = (int) (dim.getHeight() * 0.7);
new TouchAction(driver).press(point(width, startY)).waitAction(waitOptions(Duration.ofSeconds(1)))
.moveTo(point(width, endY)).release().perform();

I’ve already use waitAction but if I input it to the code I will get this error:

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: The swipe did not complete successfully
Build info: version: ‘3.14.0’, revision: ‘aacccce0’, time: ‘2018-08-02T20:05:20.749Z’

The result same as my current result, nothing happens after run your code, screen is not scrolled