title: UI Testing with Fragment after replace
body: <p>I have a App with several Fragments which are managed by one Activity. My Problem is that I want to test the Application and test the UI of each Fragment. I can test the first Fragment and get all Views of this, but when I click on a Button or something else (to replace the Fragment with another Fragment) I can't get any View of the new Fragment, but my MainActivity says that the current Fragment is the new Fragment. </p>
  
  <pre><code>@UiThreadTest
  public void testNewFragmentScrollView() {
      assertTrue(mActivity.getFragmentType().equals(FragmentTypes.FRAGMENT_STARTSCREEN));
      ivNewFragment.performClick(); // replace fragment
      sleep();
      assertTrue(mActivity.getFragmentType().equals(FragmentTypes.FRAGMENT_NEW));
      //get something from new fragment, ID is copied from xml file and not false
      ScrollView scrollView = (ScrollView) mActivity.findViewById(R.id.sv_fragment_new_scrollable);    
      assertTrue(scrollView != null); //#false???
      mActivity.finish();
  }
  </code></pre>
  
  <p>Do I have to update something in my Testclass or why i'm getting no Views from the new Fragment?</p>