I. First, configure the most basic environment
Knowledge preparation + Environment configuration for Android Automated Testing
(Click to view details)
2. Download robotium
Open: http://code.google.com/p/robotium/
Download: robotium-solo-3.4.1.jar (dependent on this package when writing test cases) robotium-solo-3.4.1-javadoc.jar (you can view the various APIs provided after decompression)
3. Create a test project
1. Import tested application-new test project-dependent tested application (tested application download: http://download.csdn.net/detail/wirelessqa/4487252)
2. The manifest. xml of the test project is as follows:
<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.athrun.android.app.test" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" /> <instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPackage="org.athrun.android.app" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <uses-library android:name="android.test.runner" /> </application></manifest>
Java buile path:
Be sure to check the project and robotium-solo-3.3.jar to be tested, otherwise an error will be reported.