# Unable to scroll till desired element in list in iOS automation

**URL:** <https://discuss.appium.io/t/unable-to-scroll-till-desired-element-in-list-in-ios-automation/25088>\
**Category:** Support\
**Created:** [February 2, 2019, 5:58am UTC](https://discuss.appium.io/t/unable-to-scroll-till-desired-element-in-list-in-ios-automation/25088 "2019-02-02T05:58:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandeepsav](https://discuss.appium.io/letter_avatar_proxy/v4/letter/s/e47c2d/32.png) [@sandeepsav](https://discuss.appium.io/u/sandeepsav)\
**Post date:** [February 2, 2019, 5:58am UTC](https://discuss.appium.io/t/unable-to-scroll-till-desired-element-in-list-in-ios-automation/25088/1 "2019-02-02T05:58:23Z")

</div>

Hi Team,  
I am testing iOS app where i need to scroll up/down till element visible.  
I used below code but able to scroll just bit up not till desired element.

/----------------Code-----------------------------/  
JavascriptExecutor js=(JavascriptExecutor)driver;  
HashMap\<String, String\> swiptObject = new HashMap\<\>();

scrollObject.put(“element”,((MobileElement) driver.findElement(By.className(“XCUIElementTypeTable”))).getId());  
scrollObject.put(“predicateString”, “value == '” + “T2AutoReservedTask” + “’”);  
swiptObject.put(“direction”,“up”);  
swiptObject.put(“toVisible”, “true”);  
js.executeScript(“mobile:scroll”, swiptObject);  
/----------------Code-----------------------------/

DOM of the app looks like  
XCUIElementTypeTable  
XCUIElementTypeCell  
XCUIElementTypeStaticText Test1  
XCUIElementTypeCell  
XCUIElementTypeStaticText Test2  
XCUIElementTypeCell  
XCUIElementTypeStaticTex Test3

**Java Client:**  
java-client  
6.1.0

Please let me know if anyone know why it is not scrolling till desired element.  
Thanks in advance!

Sandeep
