Issue
How do I get the View from a Matcher?
I need to get the bitmap from a specific element which findbyview is not giving specifically but I could get it by specifying more matchers
Solution
Use the check
method of ViewInteraction
and implement a custom ViewAssertion
Example in Kotlin:
onView(TODO("ADD YOUR MATCHER")).check { view, noView ->
// Get bitmap here
}
Example in Java:
onView(/* TODO("ADD YOUR MATCHER") */).check(new ViewAssertion() {
@Override
public void check(View view, NoMatchingViewException noViewFoundException) {
// Get bitmap here
}
});
Answered By - Mosius
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.