M.A.Murali
M.A.Murali

Reputation: 10148

Unable to find instrumentation info for: ComponentInfo{../android.support.test.runner.AndroidJUnitRunner}

I have written a simple Android instrumental test case to test networking operation.

Test case class name: Main3ActivityTest.java
Method name:addNewEmployee

I run my test case using command line then I got following exception.

Command:
./adb -s emulator-5554 shell am instrument -w -r -e class murali.myapplication.Main3ActivityTest#addNewEmployee murali.myapplication.test/android.support.test.runner.AndroidJUnitRunner

Issue:
INSTRUMENTATION_STATUS: id=ActivityManagerService
    INSTRUMENTATION_STATUS: Error=Unable to find instrumentation info for: ComponentInfo{murali.myapplication.test/android.support.test.runner.AndroidJUnitRunner}
    INSTRUMENTATION_STATUS_CODE: -1
    android.util.AndroidException: INSTRUMENTATION_FAILED: murali.myapplication.test/android.support.test.runner.AndroidJUnitRunner
        at com.android.commands.am.Am.runInstrument(Am.java:1093)
        at com.android.commands.am.Am.onRun(Am.java:371)
        at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
        at com.android.commands.am.Am.main(Am.java:100)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:251)

My Test case (murali.myapplication.Main3ActivityTest) is not found in the instrumentation list:

$ ./adb -s emulator-5554 shell pm list instrumentation
instrumentation:com.android.emulator.smoketests/android.support.test.runner.AndroidJUnitRunner (target=com.android.emulator.smoketests)
instrumentation:com.android.smoketest.tests/com.android.smoketest.SmokeTestRunner (target=com.android.smoketest)
instrumentation:com.example.android.apis/.app.LocalSampleInstrumentation (target=com.example.android.apis)

I have added testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

Please help me to figure out the problem?

Upvotes: 2

Views: 1295

Answers (1)

Kunal Lalwani
Kunal Lalwani

Reputation: 11

Looks like you have not installed the app- Install the app using:

$adb shell pm install -r <directory/apk_name> 

You will be able to see your instrumentation running then:

$adb shell pm list instrumentation

Upvotes: 1

Related Questions