AmbiguousViewMatcherException multiple RecyclerViews

You have multiple views with id R.id.recyclerView in your view hierarchy, therefore espresso lacks to perform correct matching. Make the ids of those RecyclerViews unique.


onView(allOf(withId(R.id.recyclerView), isDisplayed())) onView(withId(R.id.recyclerView)).perform(swipeUp())

But caught error only on second line.

Then perform matching this way:

onView(allOf(withId(R.id.recyclerView), isDisplayed())).perform(swipeUp())