Hi,
Use waitForActivity or assertCurrentActivity.
/Renas
I'm trying to get started with Robotium. I figured our login page would be a good place to start. This is the way our login page currently works:1) Start the UserProfile activity2) If user is not logged, start the Login activity3) User enters login criteria, clicks log in. This logs the user in and finishes the Login activity, returning to ProfileI'd like to test that the user's click on the login button correctly logs the user in and returns to the Profile activity. To do this I based my test on the UserProfile activity. However I can't get my test case to recognize that the activity has changed from UserProfile to Login. The posts I've seen suggest that I should base my test on the Login activity. This works fine until the user clicks login and the activity finishes with nowhere to return to.Any suggestions for how I can get this to work in Robotium?Thanks!--
You received this message because you are subscribed to the Google Groups "Robotium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotium-develo...@googlegroups.com.
To post to this group, send email to robotium-...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotium-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
If I change my test method as below, it's still not working. I'm still getting the Profile class when I call getActivity, and it fails to find my button that is on the Login page. Oddly, in this case both waitForActivity and assertCurrentActivity hang when called after the getting the new Solo object and calling getActivity().
public void testSigninButton() {
try {
Thread.sleep(3000);
} catch( Exception ex ) {
}
solo = new Solo(getInstrumentation());
String s = getActivity().getClass().getName();
Log.d("LoginTest2", "Activity after new Solo: " + s);
Button signin = (Button) solo.getView(R.id.zzz_signin);
solo.clickOnView(signin);
//solo.waitForActivity(Login.class, 15000);
//solo.assertCurrentActivity("Not on login screen", Login.class);
}
> >> email to robotium-developers+unsub...@googlegroups.com <javascript:>.
> >> To post to this group, send email to robotium-...@googlegroups.com<javascript:>
> >> .
> >> Visit this group at
> >>http://groups.google.com/group/robotium-developers?hl=en.
> >> For more options, visithttps://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Robotium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotium-develo...@googlegroups.com.
To post to this group, send email to robotium-...@googlegroups.com.
Please submit this issue in the issue tracker.
/Renas
Thanks, appreciate the quick responses. The activity is definitely in the same process. It seems the reason it can't find the button is that solo never gets initialized to the new activity.Activity A (Profile) starts, immediately starts activity B (Login) then B finishes and returns to A. My test never seems to see activity B. I can't start the test on activity B since when it finishes I want to confirm that it returns to activity A.
> >> email to robotium-developers+unsubscribe...@googlegroups.com <javascript:>.
> >> To post to this group, send email to robotium-...@googlegroups.com<javascript:>
> >> .
> >> Visit this group at
> >>http://groups.google.com/group/robotium-developers?hl=en.
> >> For more options, visithttps://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Robotium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotium-developers+unsub...@googlegroups.com.
To post to this group, send email to robotium-...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotium-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
Thanks, appreciate the quick responses. The activity is definitely in the same process. It seems the reason it can't find the button is that solo never gets initialized to the new activity.
Activity A (Profile) starts, immediately starts activity B (Login) then B finishes and returns to A. My test never seems to see activity B. I can't start the test on activity B since when it finishes I want to confirm that it returns to activity A.
> >> email to robotium-developers+unsubscribe...@googlegroups.com <javascript:>.
> >> To post to this group, send email to robotium-...@googlegroups.com<javascript:>
> >> .
> >> Visit this group at
> >>http://groups.google.com/group/robotium-developers?hl=en.
> >> For more options, visithttps://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Robotium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotium-developers+unsub...@googlegroups.com.