private void populateList() {
        // Given a SwipeRefreshLayout which is displaying a populated list
        getInstrumentation().invokeMenuActionSync(mTestActivity, R.id.menu_refresh, 0);
        while (mSwipeRefreshLayout.isRefreshing()) {
            // Waiting for the manual refresh to finish
        }
    }
Test that selecting the refresh menu item triggers a refresh.
SwipeRefreshMultipleViews/Application/tests/src/com/example/android/swiperefreshmultipleviews/tests/SampleTests.java