sangmingming / robotium

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

assertCurrentActivity() doesn't work on ICS #225

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an Activity A with a button which launch another Activity B
2. In the test case start Activity A and click on the button.
3. Sleep for 5 seconds (to allow the activity to be launch)
4. Then do assertCurrentActivity(B.class)

What is the expected output? What do you see instead?
The assertCurrentActivity fail. It says that the current activity is A whereas 
the activity B is launched.

What version of the product are you using? On what operating system?
I'm using the latest version of Robotium (3.1) on a Samsung Nexus S (Android 
4.0.3).

Please provide any additional information below.
I tested the same test on another versions of Android (HTC Vision with 2.3.3 
and emulator with 2.1) and it works.

Original issue reported on code.google.com by Xavier.B...@gmail.com on 8 Feb 2012 at 1:44

GoogleCodeExporter commented 9 years ago
Please try it on the emulator.

Original comment by renasr...@gmail.com on 8 Feb 2012 at 4:17

GoogleCodeExporter commented 9 years ago
am experiencing the same problem on 4.0.3

Original comment by ebelets...@gmail.com on 9 Feb 2012 at 5:46

GoogleCodeExporter commented 9 years ago
Well, this is weird. I did a simple test case to reproduce the bug and it works 
on the emulator. I'll try tomorrow on the phone this simple test.

Original comment by Xavier.B...@gmail.com on 9 Feb 2012 at 10:19

GoogleCodeExporter commented 9 years ago
I tested my simple test case on the Nexus S and it worked... I guess I have a 
problem with my complexe test case...
I think you can close the issue.

Original comment by Xavier.B...@gmail.com on 10 Feb 2012 at 8:15

GoogleCodeExporter commented 9 years ago

Original comment by renasr...@gmail.com on 10 Feb 2012 at 10:05

GoogleCodeExporter commented 9 years ago
I'm have the same problem, using an AVD with 4.0.3 , when I run complex test 
scenarios, and the problems is where I use the 
solo.assertCurrentActivity("Asserting " + activityClass.getSimpleName(), 
activityClass);   , the current Activity is not update, stay in the last Activy 
. Using the names of the first post, the current Activy, for Robotium is 
'Activity A', but the app is running the 'Activity B'.

I using and AVD with 1024 Mib and SDK 4.0.3 , and the last Robotium version 
3.1. I tested the same test on HTC Nexus One, with 2.3.4 and emulator with 2.1 
, 2.2, and 2.3.

thanks for your help.
Mariano Salvetti

Original comment by salvetti...@gmail.com on 10 Feb 2012 at 3:38

GoogleCodeExporter commented 9 years ago
I did a simple test case to reproduce the bug and it works on the emulator. 
I'll try tomorrow on the phone this simple test.

Original comment by yangdong...@gmail.com on 18 Jul 2012 at 8:56

GoogleCodeExporter commented 9 years ago
I have a same issue:
reproduce problem:
1、I have a button in Activity A ,when click it will do follow:
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);

2、when solo.clickOnButton , I can see chrome come out and loading the url to 
websit.

3、solo.assertCurrentActivity() still is the Activity A.

expected output should be the chrome activity .

Original comment by spiritch...@gmail.com on 1 Sep 2012 at 9:07

GoogleCodeExporter commented 9 years ago
I have try it in emulator sdk 2.1 and my phone 4.1.1 , same problem!

Original comment by spiritch...@gmail.com on 1 Sep 2012 at 9:08

GoogleCodeExporter commented 9 years ago
I have face the same problem while launching the activity on emulator.

Original comment by amitbarv...@gmail.com on 17 Oct 2014 at 9:12