HashMap<String, String> scrollObject = new HashMap<String, String>();
//Must be an element with scrollable property; Android (ListView,ScrollabeView) IOS (UIAScrollableView
RemoteWebElement element = (RemoteWebElement) driver.findElement(By.tagName(scrollableElement));
JavascriptExecutor js = (JavascriptExecutor) driver;
String widId = ((RemoteWebElement) element).getId();
//Text for search on the screen
scrollObject.put("text", text);scrollObject.put("element", widId);js.executeScript("mobile: scrollTo", scrollObject);
Found a simpler way in Java, here is the code :
public void toSwipeThisTo(String UnString, String OneScroll) throws Exception {
// fonction to close
WebElement button = driver.findElementByAccessibilityId(UnString);
button.click();
WebElement scrollButton = driver.findElementByClassName(UIAPickerWheelString);
scrollButton.sendKeys(OneScroll);