Tuesday, 10 September 2013

Robotium test single app with two package structures

Robotium test single app with two package structures

I'm trying to setup Robotium and have a problem getting it to run with my
current package structure. I believe the trouble is because my apk's
package is com.name1.mobile but my launcher activity is
com.name2.mobile.login.LoginActivity (name1 and name2 substituted for
actual package name for anonymity).
So far the most helpful tidbit for me with Robotium setup is this
To make this work you need to know the package name and the launcher
activity name. Those can be obtained by starting the application in the
emulator and whatching the logs (adb logcat). The log shows what the
package name and the activity name are. An example of how the log message
can look like: "Starting activity: Intent { act=android.intent.action.MAIN
cat=android.intent.category.LAUNCHER? flg=0x10200000
cmp=com.example.android.notepad/.NotesList"
This is what my application logs
Starting: Intent { act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER]
cmp=com.name1.mobile/com.name2.mobile.login.LoginActivity }
If I'm violating some android standard by having multiple package
structures I'd appreciate input on that otherwise the closest answer to
this I've been able to find is from here but it's speaking more to testing
two applications.
Is it possible to write a test case that spans over 2 applications?
No, that is not possible. In the AndroidManifest.xml you state which
target application you want to test.
Does this apply to me since I have two package structures within a single
application?

No comments:

Post a Comment