jeudi 1 octobre 2015

How to get the child of a view which is not having an id in android test

I want to open the navigation drawer with a click on the Hamburger menu icon during a test.

Currently the Hierarchy of the action bar is as follows:

...
Toolbar (@id/action_bar)
  TextView (no-id)
  ImageButton (no-id) <-- this is the hamburger menu
  ...
...

using Espresso there is only Matchers for withId, withText, etc. which doesn't serves my purpose here.

Aucun commentaire:

Enregistrer un commentaire