# Scrolling the page till the end

**URL:** <https://discuss.appium.io/t/scrolling-the-page-till-the-end/6807>\
**Category:** Support\
**Created:** [October 29, 2015, 7:26am UTC](https://discuss.appium.io/t/scrolling-the-page-till-the-end/6807 "2015-10-29T07:26:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bindu](https://discuss.appium.io/letter_avatar_proxy/v4/letter/b/aca169/32.png) [@bindu](https://discuss.appium.io/u/bindu)\
**Post date:** [October 29, 2015, 7:26am UTC](https://discuss.appium.io/t/scrolling-the-page-till-the-end/6807/1 "2015-10-29T07:26:02Z")

</div>

How to scroll a page till the end using java

---

<div class="post-metadata">

**Author:** ![Selvi\_Ranganathan](https://discuss.appium.io/user_avatar/discuss.appium.io/selvi_ranganathan/32/1675_2.png) [@Selvi\_Ranganathan](https://discuss.appium.io/u/Selvi_Ranganathan)\
**Post date:** [October 29, 2015, 9:31am UTC](https://discuss.appium.io/t/scrolling-the-page-till-the-end/6807/2 "2015-10-29T09:31:38Z")

</div>

// use below code to scroll down the page. Below code works fine for me in iOS app.

public static void scrollDown(AppiumDriver driver, WebElement element) {  
JavascriptExecutor js = (JavascriptExecutor) driver;  
HashMap\<String, String\> scrollObjects = new HashMap\<String, String\>();  
scrollObjects.put(“direction”, “down”);  
scrollObjects.put(“element”, ((RemoteWebElement) element).getId());  
js.executeScript(“mobile: scroll”, scrollObjects);  
try {  
Thread.sleep(1000);  
} catch (InterruptedException e) {  
e.printStackTrace();  
}  
}

---

<div class="post-metadata">

**Author:** ![bindu](https://discuss.appium.io/letter_avatar_proxy/v4/letter/b/aca169/32.png) [@bindu](https://discuss.appium.io/u/bindu)\
**Post date:** [October 29, 2015, 11:12am UTC](https://discuss.appium.io/t/scrolling-the-page-till-the-end/6807/3 "2015-10-29T11:12:58Z")

</div>

Thank you!! It worked for me.
