I am working with selenium 2.53
, Java 1.8
, Appium 1.5.3
for automation of Native mobile applications. Now i have a condition where length of page is too large and i have to click at the bottom of the page. If i do scroll page down manually while tests are running before clicking through automation- Click works fine. But i am unable to scroll down the page using code. I have tried many different code sets. right now i am trying the below code. But this as well is not working.
Now the question is: How can we scroll the page of native application to a specific element and click on that element?
JavascriptExecutor js = driver;
element = driver.findElement(getMethodToCall(object, byCall));
HashMap<String, String> scrollObject = new HashMap<String, String>();
scrollObject.put("direction", "down");
scrollObject.put("element", ((RemoteWebElement) element).getId());
js.executeScript("mobile: scroll", scrollObject);