I have a horizontal RecyclerViewinside a vertical RecyclerView. I am using this code, which I found on another question:
onView(allOf(isDescendantOfA(withRecyclerView(R.id.parentVerticalRecyclerView).atPosition(parentPosition)),
isDescendantOfA(withRecyclerView(R.id.childHorizontalRecyclerView).atPosition(childPosition)),
(withText("USA"))))
.perform(click());
// It is not working for parentPosition > 0
but this only works for the first line of the parent RecyclerView.
How do I click an element on the child RecyclerView of the second row of the parent RecyclerView?
source
share