How to perform scroll gesture for iOS mobile app in iOS simulator?

These are methods inside AppiumDriver / AndroidDriver Class
scrollTo() and scrollToExact() methods

What you have to do here is find tableView element and then cast the WebElement to Android or IOSElement and then perform scroll operation on it.
WebElement parentElem = driver.findElement(MobileBy.xpath("//UIATableView[3]"));
((IOSElement)parentElem).scrollTo(“text”);

Hope this answers your question

Guys, Any success on swiping from left to right and vice versa?

I am using
iOS_Driver.swipe(…)

but no success.?

Try driver.swipe(100,250,50,250,500); to swipe from Left to right.

i tried this and it swipes down, how does it make sense?

Any suggestions on scrollTo options on XCUITest elements?

public static void scrollios(String move){
//down,up,left,right
JavascriptExecutor js = (JavascriptExecutor) driver;
HashMap<String, String> scrollObject = new HashMap<String, String>();
scrollObject.put(“direction”, move);
js.executeScript(“mobile: scroll”, scrollObject);

}

Inside the move parameter mention the direction:up, down,right and left

public static void scrollios(String move){
//down,up,left,right
JavascriptExecutor js = (JavascriptExecutor) driver;
HashMap scrollObject = new HashMap();
scrollObject.put(“direction”, move);
js.executeScript(“mobile: scroll”, scrollObject);

}
Inside the move parameter mention the direction:up, down,right and left

1 Like

If ur using swipe functionalty use negative in end y value…
driver.swipe(150,350,150,-100,300);

hey frnd, i am able to swipe left or right, but it always swipe 2nd row of the cell, any idea to make it dynamic?

using JavascriptExecutor js = (JavascriptExecutor) driver;
HashMap scrollObject = new HashMap();
scrollObject.put(“direction”, move);
js.executeScript(“mobile: scroll”, scrollObject);

Using Java Script Executor it is actually scrolling down the Notification panel of Wifi not the Native Application.
Any Idea how to perform scrolling in application ??

Details can be found on below link:

http://appium.io/docs/en/writing-running-appium/touch-actions/