Android - Is there a single method to Scroll and validate the required set of elements are available

In Android elements that are not visible are not added into the hierarchy - so if it’s not visible then you don’t know if it exists. these are the approaches that I’ve seen so far:
1: scroll by passing coordinates and then check if element exits (http://appium.io/docs/en/commands/interactions/touch/scroll/)
2: scroll by using screen ratios (How to perform scroll/swipe top to bottom)

I took another approach:
get parent element -> get all child elements (you can get only the visible ones) -> scroll from last element to first element -> get all new child elements -> compare new elements with old elements (if both are the same then you have reached the end of the list)

1 Like