What is the correct way to open NavigationDrawer and select items from the navigation list in Robotium 5.1? I tried
solo.setNavigationDrawer(Solo.OPENED);
clickInList(position);
yet they're not working.
What is the correct way to open NavigationDrawer and select items from the navigation list in Robotium 5.1? I tried
solo.setNavigationDrawer(Solo.OPENED);
clickInList(position);
yet they're not working.
If you examine a navigation drawer activity with uiautomatorviewer
you can notice that the navigation drawer menu button is the first ImageButton
. So you can invoke the menu and press the first item through:
solo.clickOnImageButton(0);
// open menusolo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN);
// select first itemsolo.sendKey(KeyEvent.KEYCODE_DPAD_CENTER);
// press the first item
Try this solo.clickOnScreen(50, 50);
I tried solo.clickOnActionBarHomeButton();
However sometimes it does not work. Also please refer this answer