How do I automate scrolling in a native Android application? For example, on a 'terms and conditions' page. I am using Appium with selenium webdriver.

  • Anirban - Can you accept answer if it helps you. So this question will no longer be in active queue. Sep 13, 2016 at 4:59

2 Answers 2


The snippet below is not for any particular mobile screen size. It is fetching the actual screen size each time.

    public void scroller() throws IOException 
      Dimension dimensions = ad.manage().window().getSize();
      System.out.println("Size of Window= " +dimensions);
      int scrollStart = (int) (dimensions.getHeight() * 0.5);
      System.out.println("Size of scrollStart= " +scrollStart);
      int scrollEnd = (int) (dimensions.getHeight() * 0.2);
      System.out.println("Size of cscrollEnd= " + scrollEnd);             
      System.out.println("Screen Swiped " );

Using python-client of appium:

def _find_by_scroll(self, item_name):

    item = self.driver.find_element_by_android_uiautomator(
        'new UiScrollable(new UiSelector().scrollable(true).instance(0)).getChildByText(new UiSelector().className("android.widget.TextView"), "'
        + item_name + '")')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.