Issue
onView(withId(R.id.feeding_name)).check(matches(isDisplayed()));
causes AmbiguousViewMatcherException.
Due to multiple fragments on the screen the id "feeding_name" matches multiple views.
I am wondering, if there is any way to specify the parent of the view so that I could do something like onView(withIdAndParentId(R.id.feeding_name, R.id.fragment_show_feeding)).check(matches(isDisplayed()));
Solution
You could try combination of matchers with allOf
, like for example:
onView(allOf(withId(R.id.feeding_name), withParent(withId(R.id.fragment_show_feeding))))
.check(matches(isDisplayed()));
Answered By - Aaron
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.