1. Configure <instrumentation>: <instrumentation Android: Name = "android. Test. instrumentationtestrunner" in the manifest file"
Android: targetpackage = "com. BroadVision. proguard"/> as a sub-tag of the manifest tag,
Android: targetpackage is the package name of the test class (subclass of androidtestcase) created in the following steps.
2. configure <uses-library>: <uses-library Android: Name = "android. test. runner "/> as the sub-tag of the <Application> tag (that is, put it in it ).
3. Create a New testcase package: COM. BroadVision. proguard can be any package name, which should be consistent with the package name in step 1.
4. Create a subclass of androidtestcase under the new package, such as maintestcase.
6. Add a test method to the newly created maintestcase class. The method name must start with test and be modified with public void, as shown in figure
Public void testsomething () throws throwable {
// Method body
}
7. Right-click the project and run it as "android JUnit test". The following result is displayed:
Or:
Android executes the Android: Test Method of all androidtestcase subclasses under the targetpackage, and displays them in a tree structure.
Valid information such as the Execution success and execution time of the test methods.
Thank you for your correction.