How to swipe vertically in android device? (Appium)
Published in
1 min readMar 11, 2019
Answer:
//Swipe from Bottom to Top.
driver.swipe(startx, starty, startx, endy, 3000);
//Swipe from Top to Bottom.
driver.swipe(startx, endy, startx, starty, 3000);
//Get the size of screen.
Dimension size = driver.manage().window().
getSize();
//Find swipe start and end point from screen’s with and height.
int starty = (int) (size.height * 0.80);
//Find endy point which is at top side of screen.
int endy = (int) (size.height * 0.20);
//Find the horizontal point where you want to swipe. It is in middle of screen width.
int startx = size.width / 2;
Note: This code will work for Java client below 6.0.* version.
Reference: (Click Here)