Skip to content Skip to sidebar Skip to footer

Run Espresso In Activityinstrumentationtestcase2

I have written some test cases but when I try to include espresso in it, it shows java.lang.IllegalStateException: No instrumentation registered! Must run under a registering instr

Solution 1:

Even if you are using ActivityInstrumentationTestCase2, you still must use the test support lib runner to use the things from the test support lib, like this:

android {
    defaultConfig {
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
}

http://developer.android.com/tools/testing-support-library/index.html

Post a Comment for "Run Espresso In Activityinstrumentationtestcase2"