austgl / robotium

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

The packageName is not test build, it is tested build. #121

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Like test build's packageName is com.demo.test, tested build's packageName is 
com.demo.
Use this method to get packageName in test:
activity.getApplicationContext().getApplicationInfo().packageName

We get the packageName is "com.demo", not "com.demo.test".

Original issue reported on code.google.com by derek110...@gmail.com on 22 Jun 2011 at 2:00

GoogleCodeExporter commented 9 years ago
I am not sure what the issue is. However if it is platform issues then please 
submit them to the Android issue tracker.

Original comment by renasr...@gmail.com on 22 Jun 2011 at 8:02

GoogleCodeExporter commented 9 years ago
There is Android Application "Demo", its' packageName is "com.demo".
Now, we use Robotium Framework to test "Demo", our test Application is 
"DemoTest", its' packageName is "com.demo.test".

In "DemoTest", we use this method to get packageName in "DemoTest.java":
activity.getApplicationContext().getApplicationInfo().packageName

The returned packageName is "com.demo", not "com.demo.test".

Could you tell me why, it's strange.

Original comment by derek110...@gmail.com on 22 Jun 2011 at 1:12

GoogleCodeExporter commented 9 years ago
You are asking the activity what the package name is. The activity belongs to 
the application Demo. That is why you get com.demo back.

Original comment by renasr...@gmail.com on 22 Jun 2011 at 1:33

GoogleCodeExporter commented 9 years ago
I understand that.
Thank you very much.

Original comment by derek110...@gmail.com on 23 Jun 2011 at 2:30