public void test() throws Throwable { ViewFlipper mFlipper = ((ViewFlipper) getActivity().findViewById(R.id.help_flipper)); assertTrue(mFlipper != null); assertEquals( "At Changelog page", HelpActivity.PAGE_INDEX_CHANGELOG, mFlipper.getDisplayedChild()); View changeLogView = getActivity().findViewById(R.id.changelog); assertTrue(changeLogView != null); DbUtils.waitMs("test", 500); ActivityTestHelper<HelpActivity> helper = new ActivityTestHelper<HelpActivity>(this, MySettingsActivity.class); assertTrue( "Click on ActionBar item", helper.clickMenuItem("Clicking on Settings menu item", R.id.preferences_menu_id)); Activity nextActivity = helper.waitForNextActivity("Clicking on Settings menu item", 10000); DbUtils.waitMs("test", 500); nextActivity.finish(); }