Closed GoogleCodeExporter closed 9 years ago
More specific Bug reproduction steps:
1. Launch first Activity (Activity1)
2. Click Button, and launch second Activity (Activity2)
3. Click SignOut (Causes the app to open another Activity1)
4. Test done
Is it possible that since my last Activity class is the same as the first one,
it's not trying to quit it. Although the activity classes are the same, they
are different instances of this class.
Original comment by ary...@gmail.com
on 14 Dec 2011 at 7:32
How often does this happen?Is it always the same activity that is not finished?
Would it be possible for you to send me your application?
Original comment by renasr...@gmail.com
on 15 Dec 2011 at 8:06
It happens probably 95% of the times. and yes, it's always the same activity,
because all my tests start with a sign in and end with a sign out.
Unfortunately, I can't share the application. I downloaded the source code for
Robotium and I'm trying to troubleshoot this problem. I'll keep you updated
with more information.
Original comment by ary...@gmail.com
on 15 Dec 2011 at 2:54
I created a sample project that demonstrates this bug.
Is it possible that the logic below is causing the problem (getCurrentActivity
method under ActivityUtils.Java)
I think this logic does not allow multiple Activities with the same class to be
added to activityList array, and therefore finish doesn't get called on all
live activities.
for(int i = 0; i < activityList.size(); i++){
storedActivity = activityList.get(i);
if (storedActivity.getClass().getName().equals(
activity.getClass().getName()))
found = true;
}
if (found)
return activity;
else {
activityList.add(activity);
return activity;
}
Original comment by ary...@gmail.com
on 16 Dec 2011 at 5:31
Attachments:
Thanks for reporting this. The issue will be fixed in the next release.
Original comment by renasr...@gmail.com
on 16 Dec 2011 at 6:47
This has been fixed in Robotium 3.1.
Original comment by renasr...@gmail.com
on 9 Jan 2012 at 11:59
Thanks for the fix, this fixed the problem In the sample project; however, my
actual project still does not work properly. I am still investigating this,
I'll report a new bug when I can verify that this problem is not specific to my
application.
Thanks again
Original comment by ary...@gmail.com
on 9 Jan 2012 at 5:06
You could try to use the second solo constructor Robotium(Instrumentation
instrumentation) and then call getActivity() after the solo object is created.
Original comment by renasr...@gmail.com
on 9 Jan 2012 at 5:32
[deleted comment]
Sorry for the delay, I haven't been working on automation for a while.
You said call getActivity(), but solo doesn't have a method called
getActivity(), did you mean getCurrentActivity().
I tried the following and this change completely prevents solo from interacting
with my application.
solo = new Solo(getInstrumentation());
solo.getCurrentActivity();
Original comment by ary...@gmail.com
on 23 Jan 2012 at 11:13
Please try the following:
solo = new Solo(getInstrumentation());
getActivity(); //included in ActivityInstrumentationTestCase2
Original comment by renasr...@gmail.com
on 24 Jan 2012 at 4:17
With very customized back stack and the last activity has "press Back Twice to
exit", Robotium has difficulty handling the tearDown(). This issue may be the
cause of Issue 172
Original comment by airg.aut...@gmail.com
on 28 Jan 2012 at 2:01
I tried the code you suggested, but that doesn't work.
while using this code, solo can't interact with the application at all.
I'll try "pressing back twice" and I'll post the result.
Original comment by ary...@gmail.com
on 28 Jan 2012 at 2:05
Original issue reported on code.google.com by
ary...@gmail.com
on 14 Dec 2011 at 6:22