I am trying to click the home icon in some Espresso tests via:
onView(withId(android.R.id.home)).perform(click());
This works fine for Android > 3.0 - but fails for older versions 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?
Or
Use the
withContentDescription()
Matcher
:I had trouble navigating back from one Activity to another, but then I found top-level actions:
this works always!
Maybe you can call:
If your intention is opening / closing the drawer, I recommend using the Espresso contrib library: