I have a RecyclerView (R.id.recyclerView) where each row has an image (R.id.row_image) and a TextView. I want to click on the image in the first row.
I've tried to use onData(..) but it doesn't seem to work.
onView(withId(R.id.recyclerView))
.perform(actionOnItemAtPosition(0, click()));
Include this in your gradle script:
dependencies {
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.0'
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.0'
}