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:

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

Graduate Student in Information System Management at Carnegie Mellon University. Previously worked as Marketing Technology Analyst and Data Analyst in Traveloka.com. Passionate about new technology and have interest in data, business and investment. Ex-Microsoft Student Partner. Graduated from Information System, Faculty of Computer Science, Universitas Indonesia.

Leave a Reply

Your email address will not be published. Required fields are marked *