ligi ligi - 3 months ago 26x
Android Question

click home icon with espresso

I am trying to click the home icon in some espresso tests via:


this works fine for Android>3.0 - but fails below as appcompat does not seem to use this id for this element then. What is a good approach to do what I want to do?


Use the withContentDescription() Matcher:

onView(withContentDescription("Navigate up")).perform(click());