How can I swipe scroll to bottom in an android app using appium
?
I tried using
driver.swipe(300,800,300,500,2);
driver.scrollTo("string")
But above did not helped. Can anyone suggest me some generic solution ?
How can I swipe scroll to bottom in an android app using appium
?
I tried using
driver.swipe(300,800,300,500,2);
driver.scrollTo("string")
But above did not helped. Can anyone suggest me some generic solution ?
A generic solution will be scrolling using dimensions. use the below code
public void scroll() throws IOException {
try {
Dimension dimensions = driver.manage().window().getSize();
System.out.println("Size of screen= " +dimensions);
int Startpoint = (int) (dimensions.getHeight() * 0.5);
System.out.println("Size of scrollStart= " +Startpoint );
int scrollEnd = (int) (dimensions.getHeight() * 0.2);
System.out.println("Size of cscrollEnd= " + scrollEnd);
driver.swipe(0, Startpoint,0,scrollEnd,1000);
} catch (IOException e) {
}
}
add this to ur code and simply use scroll(); in ur test case. Modify the decimal values given in the code to nmeet your requirements