xiaofans / robotium

Automatically exported from code.google.com/p/robotium
0 stars 0 forks source link

waitForFragment() call fails though Fragment is visible #348

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
We're getting many random test errors with Robotium (3.4.1 and also 3.5.1). One 
particular issue we've picked out so far is that sometimes the waiting for a 
particular fragment fails.

Through a longer debugging intercourse we've found out that Robotium is unable 
to find the fragment because it uses a fragment manager internally that has 
already been destroyed (mDestroyed member of FragmentManagerImpl is true) and 
as such no fragment was registered for it any longer (mAdded and mActive of the 
private FragmentManagerImpl are NULL). The fragment manager itself was in state 
5 (apparently Fragment.RESUMED).

If we stop the debugger at this moment and try to retrieve the current active 
activity and its fragment manager again, then the fragment manager is valid and 
we get the positive (expected) response that the queried fragment exists.

Original issue reported on code.google.com by m...@thomaskeller.biz on 7 Nov 2012 at 4:27

GoogleCodeExporter commented 9 years ago
Thanks for reporting this. I'm not sure what can be done with this issue. The 
fragment manager is returned by the activity:

activityUtils.getCurrentActivity().getFragmentManager();

The issue here is that the activity returns a destroyed fragment manager. 

Original comment by renasr...@gmail.com on 14 Nov 2012 at 10:21

GoogleCodeExporter commented 9 years ago
Please direct this issue to the Android team.

Original comment by renasr...@gmail.com on 19 Nov 2012 at 6:50