Using an Android emulator. On a page of the app, there is a list with several components per list item. Each list item has an ID and some other text in it, in this format:
#99 - person's name here
I want to automate selecting the list item with the highest ID, since that will be the most recent item that I want to interact with. How do I go about ensuring that it will always select the highest ID, no matter what?
Screenshot here of the list, with its text fields that includes the ID and name.
I might create a collection (or two) in which I store the IDs, which you can get using the
split(' ') function, taking the first part of the list, like
myId.split(' '), and then get the max item of the collection.
EDIT: You may not have to use the split() function, Instead, just add the IDs into a collection and then check if the max function works on that
An alternative is to use the collection’s sort function and then use the highest item in the collection.