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