How to click on a button within a recycler view item using espresso?

By : Vivek

Just to take an example, say my recycler view(with id "list") is this Gmail Inbox

enter image description here

I already know onView(withId(, click()); let's me to open the second email.

But how do I just click on the star button of the second email with espresso ?

By : Vivek


Have a look at the following stackoverflow question: It creates a ViewAction that clicks a view object, identified by id, at a specific position in the recyclerView.

Using Espresso to click view inside RecyclerView item

By : JonnyL

This video can help you solving your question :)
By: admin