Best way to get all elements of a lineview in android

Dear all,
what ist the best way to get all elements of a lineview (even those that are not visible) on android?

swiping and comparing elements found?
does anyone have a nice java codefragment?

i’m currently comparing strings, as the mobilelements are not equal after an update. However this would not catch duplicate entries:

LinkedHashSet menuItemsComplete= menuItems.stream().map(x -> x.getText())
.collect(Collectors.toCollection(LinkedHashSet::new));
//on android only elements within the viewport are included in the elementTree
if (SetupHelper.isTargetAndroid()){
boolean searchElements=true;
while(searchElements)
{
menu.swipe(SwipeElementDirection.UP, 1, 1, GestureHelper.getScreenHeight()-1); //swipe one page
LinkedHashSet menuItemsTemp=menuItems.stream().map(x -> x.getText())
.collect(Collectors.toCollection(LinkedHashSet::new));
if (menuItemsComplete.containsAll(menuItemsTemp)){
searchElements=false;
}
else {
menuItemsComplete.addAll(menuItemsTemp);
}

}

}

I think that is a quite common task… :slight_smile:

found https://supriyavivek.wordpress.com/