0

I have a layout (A) that includes another layout (B) multiple times. Layout B contains a button with id R.id.my_button. As a result, layout A contains many of those buttons with the same id.

How do I test clicking on any of those buttons with espresso?

My only one unique information is I know where the layout B in layout A (B is in the layout my_layout1 for example.)

unlike this, I have not unique information. Clicking on one of many views with same id in Espresso also, I tried this, onChildView and hasSiblings with Espresso

Emad
  • 588
  • 1
  • 9
  • 22
Emre Akcan
  • 982
  • 10
  • 27

1 Answers1

1

Temporarly, i tag the buttons everytime I add a view and in espresso i used onView(withTagValue(is((Object) "mytag1"))).perform(click());

Emre Akcan
  • 982
  • 10
  • 27