vendredi 25 janvier 2019

How to click Android phone "home" button programmatically in espresso

I need to simulate home button click in Espresso on Android phone. I tried

onView(withId(android.R.id.home)).perform(click());

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

as some posts suggested but it always fails to find the view. I'm new to Espresso and not sure how to debug it. Thanks.

Aucun commentaire:

Enregistrer un commentaire