title: How to scroll down a page
body: <p>I want to scroll down to the bottom of the page, and perform an action. Using <code>uiautomator</code>, I have obtained the following:</p>
  <pre><code>index=2,
  resource-id=com.manoramaonline.arogyam:id/pager,class=android.support.v4.view.ViewPager,
  scrollable=true.
  </code></pre>
  <p>I have attempted to do this with the code below:</p>
  <pre><code>JavascriptExecutor js = (JavascriptExecutor) driver;
  RemoteWebElement element =(RemoteWebElement)driver.findElement(By.xpath(&quot;//android.support.v4.view.ViewPager[@resource-id='com.manoramaonline.arogyam:id/pager']&quot;));     
  HashMap&lt;String, String&gt; scrollObject = new HashMap&lt;String, String&gt;();
  scrollObject.put(&quot;direction&quot;, &quot;down&quot;);
  
  // This is where the error is
  scrollObject.put(&quot;element&quot;, element.getId());
  js.executeScript(&quot;mobile: scroll&quot;, scrollObject);
  </code></pre>