I have a custom ImageButton that is not fully visible, by design, so when I perform a click action I get this error:
ImageButton
android.support.test.espresso.P
You have to scroll to the button before:
onView(withId(R.id.button_id)).perform(scrollTo(), click());