Test Run Failed process crashed

1,139 views
Skip to first unread message

tommy

unread,
Nov 3, 2011, 3:43:18 AM11/3/11
to Robotium Developers
i got this error Test run failed process crashed !! while executing
the junit tests in robotium

i have given the correct package name and the activity name my log
shows

11-03 12:48:26.146: WARN/ActivityManager(53): Crash of app
com.example.notepad running instrumentation
ComponentInfo{com.example.notepad.test/
android.test.InstrumentationTestRunner}

My code is below

package com.example.notepad.test;


import com.jayway.android.robotium.solo.Solo;

@SuppressWarnings("unchecked")
public class androidtest extends ActivityInstrumentationTestCase2
{
private static final String PackageID = "com.example.notepad";
private static final String activity =
"com.example.loginactivity";
private static Class<?> CLASS;
static{
try
{
CLASS = Class.forName(activity);
}
catch(ClassNotFoundException e)
{
throw new RuntimeException(e);
}
}
public androidtest()throws ClassNotFoundException
{
super(PackageID,CLASS);
}
private Solo solo;
@Override
protected void setUp() throws Exception
{
solo =new Solo(getInstrumentation(),getActivity());
}
public void test() throws Exception
{
solo.pressMenuitem(0);
}

@Override
public void tearDown()throws Exception
{
try
{

solo.finalize();
}
catch
(Throwable e)
{
e.printStackTrace();
}
getActivity().finish();
super.tearDown();
}
}


Mystart activity is

11-03 12:58:19.115: INFO/ActivityManager(53): Starting activity:
Intent { act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER] flg=0x10200000
cmp=com.example.notepad/com.example.loginactivity }

followedby

11-03 12:58:20.118 INFO/ActivityManager(53): Starting activity:
Intent { act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER] flg=0x10200000
cmp=com.example.notepad/com.login.mainactivity }


Please help myself completely blocked in this case


Renas

unread,
Nov 3, 2011, 6:10:51 AM11/3/11
to robotium-...@googlegroups.com
Probably you have not updated the AndroidManifest.xml of the example test project so that it points to your Activity.

/Renas



--
You received this message because you are subscribed to the Google Groups "Robotium Developers" group.
To post to this group, send email to robotium-...@googlegroups.com.
To unsubscribe from this group, send email to robotium-develo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/robotium-developers?hl=en.


prasan kumar

unread,
Nov 3, 2011, 6:16:13 AM11/3/11
to robotium-...@googlegroups.com
Hi renas,
my Androidmanifest looks like

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.notepad.test"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/app_name">

    <uses-library android:name="android.test.runner" />
    </application>
    <uses-sdk android:minSdkVersion="4" />
    <instrumentation android:targetPackage="com.example.notepad" android:name="android.test.InstrumentationTestRunner" />
</manifest>



So i have pointed my target package to thepackage name in my java class.how should i point to my activity straightaway!! is there a method??

Thanks


On Thu, Nov 3, 2011 at 3:40 PM, Renas <rena...@gmail.com> wrote:
Probably you have not updated the AndroidManifest.xml of the example test project so that it points to your Activity.

/Renas

On Thu, Nov 3, 2011 at 8:43 AM, tommy <prasan...@gmail.com> wrote:
i got this error Test run failed process crashed !! while executing
the junit tests in robotium

i have given the correct package name and the activity name my log
shows

á á11-03 12:48:26.146: WARN/ActivityManager(53): Crash of app

com.example.notepad running instrumentation
ComponentInfo{com.example.notepad.test/
android.test.InstrumentationTestRunner}

My code is below

á ápackage com.example.notepad.test;


á áimport com.jayway.android.robotium.solo.Solo;

á á@SuppressWarnings("unchecked")
á ápublic class androidtest extends ActivityInstrumentationTestCase2
á á{
á áprivate static final String PackageID = "com.example.notepad";
á áprivate static final String activity =
"com.example.loginactivity";
á áprivate static Class<?> CLASS;
á ástatic{
á átry
á á{
á áCLASS = Class.forName(activity);
á á}
á ácatch(ClassNotFoundException e)
á á{
á áthrow new RuntimeException(e);
á á}
á á}
á ápublic androidtest()throws ClassNotFoundException
á á{
á ásuper(PackageID,CLASS);
á á}
á áprivate Solo solo;
á á@Override
á áprotected void setUp() throws Exception
á á{
á á á ásolo =new Solo(getInstrumentation(),getActivity());
á á}
á ápublic void test() throws Exception
á á{
á ásolo.pressMenuitem(0);
á á}

á á@Override
á ápublic void tearDown()throws Exception
á á{
á átry
á á{

á ásolo.finalize();
á á}
á ácatch
á á(Throwable e)
á á{
á áe.printStackTrace();
á á}
á ágetActivity().finish();
á ásuper.tearDown();
á á}
á á}


Mystart activity is

á á11-03 12:58:19.115: INFO/ActivityManager(53): Starting activity:

Intent { act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER] flg=0x10200000
cmp=com.example.notepad/com.example.loginactivity }

followedby

á á11-03 12:58:20.118 INFO/ActivityManager(53): Starting activity:

Intent { act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER] flg=0x10200000
cmp=com.example.notepad/com.login.mainactivity }


Please help myself completely blocked in this case


--
You received this message because you are subscribed to the Google Groups "Robotium Developers" group.
To post to this group, send email to robotium-...@googlegroups.com.
To unsubscribe from this group, send email to robotium-develo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/robotium-developers?hl=en.

Renas Reda

unread,
Nov 3, 2011, 6:20:21 AM11/3/11
to Robotium Developers
You need to update this: android:targetPackage="com.example.notepad"
to the correct package name of your application. You can find out the
package name by looking at the log when starting the Activity.

/Renas

On Nov 3, 11:16 am, prasan kumar <prasantest...@gmail.com> wrote:
> Hi renas,
> my Androidmanifest looks like
>
> <?xml version="1.0" encoding="utf-8"?>
> <manifest xmlns:android="http://schemas.android.com/apk/res/android"
>       package="com.example.notepad.test"
>       android:versionCode="1"
>       android:versionName="1.0">
>     <application android:icon="@drawable/icon"
> android:label="@string/app_name">
>
>     <uses-library android:name="android.test.runner" />
>     </application>
>     <uses-sdk android:minSdkVersion="4" />
>     <instrumentation android:targetPackage="com.example.notepad"
> android:name="android.test.InstrumentationTestRunner" />
> </manifest>
>
> So i have pointed my target package to thepackage name in my java class.how
> should i point to my activity straightaway!! is there a method??
>
> Thanks
>
>
>
>
>
>
>
> On Thu, Nov 3, 2011 at 3:40 PM, Renas <renasr...@gmail.com> wrote:
> > Probably you have not updated the AndroidManifest.xml of the example test
> > project so that it points to your Activity.
>
> > /Renas
>

sonia andrews

unread,
Apr 18, 2013, 8:02:57 AM4/18/13
to robotium-...@googlegroups.com
I think u have given the activity name wrongly.

"private static final String PackageID = "com.example.notepad";
    private static final String activity =
"com.example.loginactivity";"

it shud be :
private static final String activity ="com.example.notepad.loginactivity"


On Thu, Apr 18, 2013 at 3:58 PM, <cybag...@gmail.com> wrote:
Hi,
 
I am facing the same error issue "Test run failed: Instrumentation run failed due to 'Process crashed.'".
I have entered the correct name of the target package .
 
Please find the attached logcat for ur info.  Could you please let me know the reason for process crashe. Thanks in advance.
--
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.

sonia andrews

unread,
Apr 19, 2013, 3:02:27 AM4/19/13
to robotium-...@googlegroups.com
please make sure u haven given launcher activity class name properly as it is throwing class not found exception.

private static final String LAUNCHER_ACTIVITY_FULL_CLASSNAME = "com.ad60.blackplanet.activities.SplashSActivity";or com.ad60.blackplanet.SplashSActivity


On Fri, Apr 19, 2013 at 11:46 AM, <cybag...@gmail.com> wrote:
Hi Sonia,
 
Thanks for ur reply.
 
but I have mentioned the Package ID and launcher activity correctly. Still received the Test Run Failed process crashed error.
 
Please find attached logcat and project in Zip format. Please advice me on the same. Many Thanks!
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.

Saneesh Joseph

unread,
Apr 19, 2013, 3:30:50 AM4/19/13
to robotium-...@googlegroups.com, sang...@cybage.com
Log says,
 
"java.lang.ClassNotFoundException: android.support.v4.app.ActionBarSherlockFragmentMapActivity"
"java.lang.ClassNotFoundException: com.actionbarsherlock.app.SherlockMapActivity"

Means that you dont have androidv4support jar included in your application apk. You may need to include actionbarsherlock library as well.

Just to verify the cause, try running the application manually, it should give you the same errors. Then you need to include the libraries.

Regards,
Saneesh Joseph


On Fri, Apr 19, 2013 at 11:46 AM, <cybag...@gmail.com> wrote:
Hi Sonia,
 
Thanks for ur reply.
 
but I have mentioned the Package ID and launcher activity correctly. Still received the Test Run Failed process crashed error.
 
Please find attached logcat and project in Zip format. Please advice me on the same. Many Thanks!

On Thursday, April 18, 2013 5:32:57 PM UTC+5:30, sonia wrote:
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.

cybage User1

unread,
Apr 19, 2013, 5:35:22 AM4/19/13
to robotium-...@googlegroups.com
Hi Saneesh,
 
Thanks for the reply. Now added the android support jar and rerun the app.
 
Now after running Android Junit Test it displayed bleow error
 
java.lang.NullPointerException
at android.test.InstrumentationTestCase.launchActivityWithIntent(InstrumentationTestCase.java:117)
at android.test.InstrumentationTestCase.launchActivity(InstrumentationTestCase.java:97)
at android.test.ActivityInstrumentationTestCase2.getActivity(ActivityInstrumentationTestCase2.java:104)
at com.ad60.blackplanet.test.TestApk.setUp(TestApk.java:47)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:190)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:175)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1584)
Please find attached log file for ur reference. Many thanks for your help!!
 
Waiting for reply...


--
You received this message because you are subscribed to a topic in the Google Groups "Robotium Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/robotium-developers/irJ7nbFaecI/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to robotium-develo...@googlegroups.com.
log.txt

Saneesh Joseph

unread,
Apr 19, 2013, 6:08:10 AM4/19/13
to robotium-...@googlegroups.com

Notice ActivityInstrumentationTestCase2<T extends android.app.Activity>
ActivityInstrumentationTestCase2 is a generic class, it needs a type when you extend it. I believe you are missing it.

Add the type to your test class, something like :
public class MyLoginTest extends ActivityInstrumentationTestCase2<MyAppMainActivity> {
}

It should work.

-- Saneesh
Reply all
Reply to author
Forward
0 new messages