ActivityManager is unable to find Instrumentation target package

597 views
Skip to first unread message

Anjana

unread,
Nov 24, 2010, 11:49:36 AM11/24/10
to Robotium Developers
Hi Developers,

I used Robotium for Notepad. It worked awesome.

Now I am testing the email application. I have the apk file. The
source file has lot of packages and activities, but I have identofoed
the launcher activity.

My test application is very much like Notepad test application. But
the ActivityManager is throwing unable to find Instrumentation target
package

Question: What do I do with email.apk, do I include it some where,
where? It's urgent, please.

Thanks
Ann

Roly

unread,
Nov 25, 2010, 2:47:05 AM11/25/10
to Robotium Developers
Hi Ann,

You have the email test application Manifest file right?
And also u have the package name and class name of your email app.
Add this line in ur manifest file
<instrumentation android:targetPackage="com.android.email"
android:name="android.test.InstrumentationTestRunner" />

And also mention the package and class name in ur email test app,.

Here is how i do it.
public class Email_Test extends ActivityInstrumentationTestCase2{

private Solo solo;

// my email app Class Name
private static final String LAUNCHER_ACTIVITY_FULL_CLASSNAME =
"com.android.email.activity.Welcome";

private static Class<?> launcherActivityClass;
static{
try{
launcherActivityClass =
Class.forName(LAUNCHER_ACTIVITY_FULL_CLASSNAME);
}
catch (ClassNotFoundException e){
throw new RuntimeException(e);
}
}
@SuppressWarnings("unchecked")
public Email_Test() {
super("com.android.email",launcherActivityClass);
}

@Override
protected void setUp() throws Exception {
Log.i(TAG_STEP," 1.Launch Email application");
super.setUp();
solo = new Solo(getInstrumentation(), getActivity());
}
}


Hope this helps

Br
Reply all
Reply to author
Forward
0 new messages