Note: Be sure to modify the target package in the instrumentation in the manifest file before running the new project, which is the entrance to the test
1. Program start to notify the system what is the app I'm testing
How to know the APK package name and main activity: Get the package name and main activity via Re-sign.jar
or by: AAPT dump badging apk path and name. apk
New test class to project
Public Stopwatchtest () {
Super ("Com.sample.stopwatch", Stopwatch.class);
}
2. Add the Setup () method, each test case will call Setup to initialize, you can use the teardown () method to end the case, so you can specify to empty or end some of the resources that this case has called, if you do not write the teardown () method, The system automatically calls teardown () to empty or end all resources
protected void SetUp () throws Exception {
Super.setup ();
}
3. Method should start with test, otherwise the method will not be executed. Is the method execution not related to public, private properties?
A: There is a relationship, if the method attribute is private, the method does not execute
Robotium New Android Test project: