Using espresso, we can scroll to or perform an action on a given item in a list
We need this since sometimes the view you are interested in may not be present on the screen and espresso needs to scroll to it based on some matcher.
AdapterView has data backed by an Adapter, for this, we use onData with a custom matcher based on how the adapter is designed
For these use cases scrollTo the method won’t work since that needs an existing view
Let’s see an example and walk through how we could use espresso to scroll and act on elements for these types of components
Blog: https://automationhacks.io/2022-05-07...
Android developers: https://developer.android.com/trainin...
Code: https://github.com/automationhacks/te...