Testing ViewPager with Espresso. How perfom action to a button of an Item?
问题 I have a ViewPager whith items containing only a picture and a button. I can't successfully interact with the UI of an item (Page) because, except the displayed picture, there is nothing to differentiate (from UI point of view) all items of the ViewPager . I tried to select only one item with a position: onData(is(instanceOf(ItemClass.class))) .atPosition(0) .onChildView(withId(R.id.button)) .perform(click()); causing: NoMatchingViewException: No views in hierarchy found matching: is