Scroll Page to An Object in Appium

For some people, scrolling a page in Appium maybe not a big deal, but I found it very hard to scroll a page for my Company’s app. A few days ago, I tried to build an automation test for Traveloka app. However, I realised that Appium can only detect an element that is shown in the screen. I’ve tried many methods to scroll the screen, but no one worked for me. After browsing the solution for several hours, finally I found a workaround that is work for my issue.

So, the problem is I want to scroll this page:

Screen Shot 2016-02-21 at 11.19.29 AM

To click the orange button:

Screen Shot 2016-02-21 at 11.19.56 AM

To solve this issue, I use the following code:

AppiumDriver wd = new AndroidDriver(new URL(""), capabilities); 

// The magic code! 

As you can see that Appium will looking for a CONTINUE string in the screen and it will stop scrolling after the string is found. This way, I can click on the button because it has appeared on the screen.

Hope this is helpful and good luck with your case! 🙂

Nanda Firdaus

Ex-engineer who is switching to product management role in Traveloka. Passionate about new technology and have interest in product development, business, and investment. Ex-Microsoft Student Partner. Master of Information System Management at Carnegie Mellon University. Bachelor of Information System, Faculty of Computer Science, Universitas Indonesia.

Leave a Reply

Your email address will not be published.