How can I use Espresso to click a specific view inside a RecyclerView item? I know I can click the item at position 0 using:
onView(withId(R.i
First give your buttons unique contentDescriptions, i.e. "delivery button row 5".
Then scroll to row:
onView(withId(R.id.recycler_view)).perform(RecyclerViewActions.scrollToPosition(5));
Then select the view based on contentDescription.
onView(withContentDescription("delivery button row 5")).perform(click());
Content Description is a great way to use Espresso's onView and make your app more accessible.