android – openDrawer from espresso contrib is deprecated-ThrowExceptions

Exception or error:

Espresso contrib ( openDrawer method is deprecated

then how should I open a drawer?

How to solve:

Here’s an example on how to use the new open and close methods:




The documentation for openDrawer suggests using the open method with the correct resource id and perform ViewAction.

Use open() with perform after matching a view. This method will be
removed in the next release.


You can try this out! This will get the menu from toolbar, and press a click on him


Leave a Reply

Your email address will not be published. Required fields are marked *