In the exercise, I have ViewPagertwo tabs: ALL and Filtered.
Both pages use the same one Fragmentto display data with the difference that the "Filtered" page filters data according to some criteria.
I want to click an element on the ALL page (which may also exist on the Filtered page), and if I do this:
onData(transactionWithId(960L)).perform(click());
In response, I get:
AmbiguousViewMatcherException: 'can be assigned from a class: class android.widget.AdapterView' corresponds to several views in the hierarchy
Then I tried to clarify my description, indicating an additional restriction that I was looking for a visible element:
onData(allOf(transactionWithId(960L), isDisplayed())).perform(click());
and I got the same error.
- , "" ( , ):
onData(allOf(
transactionWithId(960L),
withParent(withText("ALL")))
).perform(click());
.
, AdapterView, :
onData(allOf(
is(instanceOf(Transaction.class)),
transactionWithId(960L))
).inAdapterView(allOf(
isAssignableFrom(AdapterView.class),
isDisplayed())
).perform(click());
:
PerformException: 'load adapter data' on view '(is : class android.widget.AdapterView ).
, , Activity ListView, , , - ViewPager , Fragment .
.