Hi @Christopher_Graham
Thanks for the detailed response.
I’m going to send you 2 files:
- CommonPages.rb //it’s a set of common page objects I have specifically for android. (I have a separate one for iOS but it probably doesn’t apply here).
- bbStudentCommonApi.rb //it’s a set of common page objects I use for android AND ios.
Notable methods:
-
bbStudentCommonApi.rb //you can find all of the swipe methods i’m using. I’m using the appium TouchAction library described here: https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/touch-actions.md
-
CommonPages.rb
- getTableCellsFromUI // gets the list of table cells on a given table view. You pass in the table view element and it returns a list of table cells start to finish.
*is_table_cell_populated // basically checks the first row "in my case “OUTLINE” that it’s populated before continuing. it’s similar to your first thought about checking for your “Loading” indicators going away before continuing.
*clickThisItem // given a text string and table view - click on the item. could be modified to click the “nth item”.
I’m attaching the 2 files and the screen shot of my table view for context. Note that this example scrolls to roughly 100 cells fyi.
About your comments:
- I haven’t tried scroll, the alternative here is to use Android UI Automator’s UIScrollable methods. Syntax like this roughly: new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().textContains(“00.jpg”).instance(0))
1a. While some people show promise with this. a) i’m not sure if it can scroll on table cells offscreen. b) i’ve heard this has broken sometime around 1.3. If you search on this site, you can find out more. Maybe there’s a workaround, who knows!
1b. I hear you about the potential concern about duplicates - and my solution has holes with that. my probability is so low for that, and if there was — there’s probably a way to put some sort of marker to identify these duplicates. I’d further say that to avoid this potential duplicates, I’d talk to my developers about adding unique resource identifiers for each table cell on the page (maybe an appended counter).
I hope you find this helpful. I have to sign out now, but please feel free to ask any follow up questions and for sure share anything out you find that may be easier!
much thanks!
eric
bbStudentCommonApi.rb.txt (6.5 KB) commonPages.rb.txt (5.9 KB)