I have a Horizontal RecyclerView
inside a vertical RecyclerView
. I'm using this code I found on other 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 first row of parent RecyclerView
.
How do I click on the element on the child RecyclerView of the second row of parent RecyclerView
?