Swipe or ScrollTo or TouchAction not working for the page is having Scroll view in iOS Simulator with Appium 1.4.13, Xcode 7.0.1, IOS 8.x/9.0 and Java-Client 3.2.0

Swipe or ScrollTo or TouchAction not working in iOS Simulator with Appium 1.4.13, Xcode 7.0.1, IOS 8.x/9.0 and Java-Client 3.2.0

Tried various ways and no luck
My Page view is “Scrollview” and it throws exception.

ScrollTo is working in “TableView” (At least not throwing an error) for the same configuration of Appium 1.4.13, Xcode 7.0.1, IOS 8.x/9.0 and Java-Client 3.2.0.

I saw other threads that Apple is not fixing scroll issues in iOS simulator but someone posted some solutions which are not working for the page is having Scrollview.

Please suggest someone got a fix for this.

Following solution works.

JavascriptExecutor js = (JavascriptExecutor) iosDriver; 
HashMap <String, String> scrollObject = new HashMap <String, String>();
scrollObject.put("element", ((RemoteWebElement) iosDriver.findElement(By.name("elementName"))).getId());
js.executeScript("mobile: scroll", scrollObject);

Thanks Hari, This solved scroll issue for our app automation too ! :relaxed:

@hnallani

Here is my code (I want to swipe from right to left)

JavascriptExecutor js = (JavascriptExecutor) iOS_Driver;
HashMap <String, String> scrollObject = new HashMap <String, String>();
scrollObject.put(“element”, ((RemoteWebElement) iOS_Driver.findElement(By.xpath("//UIAApplication[1]/UIAWindow[1]/UIAScrollView[1]/UIAScrollView"))).getId());
js.executeScript(“mobile: scroll”, scrollObject);

and i am getting this exception on executeScript line…

Exception in thread “main” org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Cannot read property ‘charAt’ of undefined (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 85 milliseconds
Build info: version: ‘2.53.0’, revision: ‘35ae25b1534ae328c771e0856c93e187490ca824’, time: ‘2016-03-15 10:43:46’
System info: host: ‘EDMXs-Mac.local’, ip: ‘192.168.204.129’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.10’, java.version: ‘1.8.0_91’
Driver info: io.appium.java_client.ios.IOSDriver

Any idea ?