Hi, I am working with APPIUM on Android. I need to scroll through the list page. I tried to do the following.
MobileElement element =(MobileElement)driver.findElement(By.className("android.widget.ListView"));
JavascriptExecutor js = (JavascriptExecutor) driver;
HashMap<String, String> scrollObject = new HashMap<>();
scrollObject.put("direction", "down");
scrollObject.put("element", ((RemoteWebElement) element).getId());
js.executeScript("mobile: scrollTo", scrollObject);
This works, but the list scrolls continuously until the last item is displayed. What I need to do is scroll through the list page.
source
share