Hey all, I'm creating an Android Test Project for the application we have been working on. I read the doc @dev guide and performed the 2 tutorials (just to tell that I'm not asking without some research first).
Well, here is the stack I got when I run the project : java.lang.RuntimeException: Unable to resolve activity for: Intent { action=android.intent.action.MAIN flags=0x10000000 comp={lu.pragma.editus.activity/ lu.pragma.editus.activity.DirectoriesNumberActivity} } at android.app.Instrumentation.startActivitySync(Instrumentation.java: 447) at android.test.InstrumentationTestCase.launchActivityWithIntent(InstrumentationTestCase.java: 106) at android.test.InstrumentationTestCase.launchActivity(InstrumentationTestCase.java: 84) at android.test.ActivityInstrumentationTestCase2.getActivity(ActivityInstrumentationTestCase2.java: 87) at lu.pragma.editus.activity.test.DirectoriesSimpleSearchTest.testEmptySearchFail(DirectoriesSimpleSearchTest.java: 48) at java.lang.reflect.Method.invokeNative(Native Method) at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java: 191) at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java: 181) at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java: 175) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:164) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:151) at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java: 418) at android.app.Instrumentation $InstrumentationThread.run(Instrumentation.java:1520) I search a lot but didn't find any question. Answers redirects to Instrumentation tutorials. One answer was to re-install the SDK, which I have done, but yet change nothing. The weird thing it's that it happens only on my project. Creating Test Project from scratch to play with sdk/samples cause no error. My test project Manifest (plus few change for business reasons) : <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="lu.pragma.editus.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="3" /> <instrumentation android:targetPackage="my.package" android:name="android.test.InstrumentationTestRunner" /> </manifest> My test : package lu.pragma.editus.activity.test; import my.package.R; import lmy.package.DirectoriesNumberActivity; import android.test.ActivityInstrumentationTestCase2; import android.text.TextUtils; import android.view.KeyEvent; import android.widget.EditText; import android.widget.ImageView; public class DirectoriesSimpleSearchTest extends ActivityInstrumentationTestCase2<DirectoriesNumberActivity> { private DirectoriesNumberActivity mActivity; private ImageView mSearchIV; private EditText mInputET; public DirectoriesSimpleSearchTest() { super("my.package", DirectoriesNumberActivity.class); } @Override protected void setUp() throws Exception { super.setUp(); this.setActivityInitialTouchMode(false); mActivity = getActivity(); mSearchIV = (ImageView) mActivity.findViewById(R.id.search); mInputET = (EditText) mActivity.findViewById(R.id.input); } @Override protected void tearDown() throws Exception { super.tearDown(); } public void testPreConditions() { assertTrue(mSearchIV != null); assertTrue(mInputET != null); assertTrue(TextUtils.isEmpty(mInputET.getText())); } public void testEmptySearchFail() { mActivity.runOnUiThread(new Runnable() { @Override public void run() { mInputET.requestFocus(); mInputET.setText(null); } }); this.sendKeys(KeyEvent.KEYCODE_ENTER); System.out.println(getActivity()); } } Do anyone has an idea / suggestion to resolve this error ? Note that standard JUnit test runs fine (I just didn't have the time to write UI test before). Thanks, Jérémy -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en