I have several buttons in my app with the same Id, I would like Espresso to click on all of them. These are basically collapse/expand buttons and thus I want the UI test to expand all elements in the view.
I am always getting:
android.support.test.espresso.AmbiguousViewMatcherException: 'with id: com.myapp.android:id/liveLinearLayout' matches multiple views in the hierarchy.
Problem views are marked with '****MATCHES****' below.
EDIT: tried this in accordance to a reply:
onView(allOf(withId(R.id.footage_layout_expand_group))).perform(click());
Got this again:
android.support.test.espresso.AmbiguousViewMatcherException: '(with id: com.myapp.android:id/footage_layout_expand_group)' matches multiple views in the hierarchy.
Problem views are marked with '****MATCHES****' below.