How to get all items matching xpath, which are not in viewport?
You need to handle scrolling on your own.
On Android, Appium can make a snapshot of what is currently in the viewport.
You can get a list of elements and iterate them, then scroll by screen hight and get another list of elements, iterate them. Repeat it until the new list is empty - make sure you don't get same elements twice.
On iOS, it's more tricky: the driver will return you elements including the ones not in the viewport. For reliable interaction, I suggest scrolling to each element.
I am automating our mobile app on iOS and Android. When I get the search results(list of elements), I want to iterate through those all elements matching my xpath.
The problem is that - Appium returns only those elements which are visible in the viewport, which makes sense. However, I would like to get all elements matching my xpath/locator strategy, although the elements are not in viewport. To get further set of elements, I have to scroll to those elements and get them into viewport.
Is there any configuration provided by appium, to enable this feature? Or will I have to continue scrolling to those elements before accessing?