Issue
I am trying use a function to check consistency of the activity graphic elements at any time. I found out that when the progressdialog is showing the espresso can't find any view bellow. Is there any way get the view bellow?
Solution
Yes, you use a RootMatcher. For example:
// Specifically target the main window view hierarchy
onView(withId(R.id.view_to_match))
.inRoot(withDecorView(is(getActivity().getWindow().getDecorView())))
.perform(click());
Or maybe:
// Specifically disregard the dialog window view hierarchy
onView(withId(R.id.view_to_match))
.inRoot(not(isDialog()))
.perform(click());
See the official documentation for an example.
Hope that helps!
Answered By - dominicoder
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.