Reputation: 13
How do I scroll down when you have multiple pages. On the third page bottom there is a link but when I use driver.scrollTo();, it skips it goes back to first page.
Upvotes: 0
Views: 322
Reputation: 1135
try driver.swipe method
Visit this link
https://automationbyharsh.blogspot.in/2017/01/how-driverswipe-works-on-ios.html
Upvotes: 0
Reputation: 91
you can use JavaScriptExecutor for scrolling i have created below method for scrolling it is working fine in iOS but have not tested for Android
public static void swipe(AppiumDriver<?> driver,String sDirection, int iCount)
{
while(iCount>0)
{
HashMap<String,String> swipeObject=new HashMap<String,String>();
swipeObject.put("direction", sDirection);
JavascriptExecutor jsDriver=(JavascriptExecutor)driver;
jsDriver.executeScript("mobile:scroll", swipeObject);
iCount--;
}
}
hope it might help :)
Upvotes: 1