I have a menu in the actionbar which I create through:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
menu.add(Menu.NONE, 98,Menu.NONE,R.stri
You can use this method to click menu item. First click menu button using this code
openActionBarOverflowOrOptionsMenu(getInstrumentation().getTargetContext());
Then perform click menu item based on text.Replace your menu item name with "MenuItemName"
onView(withText("MenuItemName")).perform(click());