Robotium?????????
???????????? ???????[ 2015/8/14 13:48:58 ] ?????????????????? Robotium
??????
????·??ο????
????·Robotium???????????汾??
????·Robotium ???????????????
????·Robotium?????Щ?????
????·???Robotiumд????case????????????
????·??????apk?????????Robotium???в?????
????·?????Robotium??????????????????
????·Robotium?????????web??棩???????
????·?????Robotium???н????
????·?????????????????Robotium ????????
????·??????????????е?????????????????
????·???????localised strings???в?????
????·??????Robotium?????case???????
??????ο????
???????? Robotium.jar???????????????build path?С????????????????? ?????
????Robotium???????????汾??
????Robotium?????1.6????????
????Robotium ???????????????
??????????????????????????????????????????????????????Щ????????汾?????????Щ?????????????????????????????Robotium???????????????
????Robotium?????Щ?????
???????????Robotium???? Javadoc??????Robotium?????й????????? ??????Щ???????Щ?????????zip??????jar???????????????????????????????????zip?????????
???????Robotiumд????case????????????
??????????????????????AndroidManifest.xml??????????????????????????????????á???????? <instrumentation android:targetPackage="com.example.android.notepad" android:name="android.test.InstrumentationTestRunner" /> ???????????????????????? com.example.android.notepad???????android???????????????????y??в?????
??????????apk?????????Robotium???в?????
????????????Robotium?????android???????
?????????Robotium??????????????????
?????????????????????root????
????Robotium?????????web??棩???????
???????????Robotium 4.0???????????web?????android??á?
?????????Robotium???н????
???????????? takeScreenshot()?????????????????浽 /sdcard/Robotium-Screenshots/?С?????????????????????AndroidManifest.xml????У???д??? android.permission.WRITE_EXTERNAL_STORAGE??
?????????????????????Robotium ????????
???????????????? adb shell am instrument -w com.android.foo/android.test.InstrumentationTestRunner com.android.foo??????????????????
??????????????????е?????????????????
??????????????????robotium????android?汾?У??????????????????AndroidManifest.xml????????????????? <uses-sdk android:targetSdkVersion="YOUR_VERSION" /> ???е? YOUR_VERSION??6--->android 2.0?? 7--->android 2.1?? 8--->android 2.2???μ??17--->android 4.2?? ???????????????Ч?????????????????????android?????е?AndroidManifest.xml????????????????? <supports-screens android:anyDensity="true"/> ???????????????Ч???????? ?????????
???????????localised strings???в?????
????Yes you can. You can use solo.getString() and in there pass in the resource id of the string that you want to use. You will need to have the source code of the application under test to access the strings.
??????????Robotium?????case????????
??????????????ant??????????????У??? ???????????????????????????root????????????????????С? ????????????裺
??????????????????android update test-project -m [??????·??] -p [?????????·??]??android?????????android sdk?μ?android.bat??????????????????????????л????????build.xml?????
???????Robotium jar????????????????£????????????μ?libs??????С?
????ant???????????????class???????????jar?????????????????????????????????build?????μ?http://stackoverflow.com/questions/2472059/cant-build-and-run-an-android-test-project-created-using-ant-create-test-projec???????????build.xml?????
????????ant coverage
??????????г????ant?????????coverage????У????溬??coverage.html????????????????????????? :) ?????????build.xml?????
<!-- override "compile" target in platform android_rules.xml to include tested app's external libraries -->
<target name="compile" depends="-resource-src?? -aidl"
description="Compiles project's .java files into .class files">
<!-- If android rules are used for a test project?? its classpath should include
tested project's location -->
<condition property="extensible.classpath"
value="${tested.project.dir}/bin/classes" else=".">
<isset property="tested.project.dir" />
</condition>
<javac encoding="ascii" target="1.5" debug="true" extdirs=""
destdir="${out.classes.absolute.dir}"
bootclasspathref="android.target.classpath"
verbose="${verbose}" classpath="${extensible.classpath}">
<src path="${source.absolute.dir}" />
<src path="${gen.absolute.dir}" />
<classpath>
<fileset dir="${tested.project.dir}/libs" includes="*.jar" />
<fileset dir="${tested.project.dir}/bin/classes" includes="*.class" />
<fileset dir="${external.libs.absolute.dir}/libs" includes="*.jar" />
</classpath>
</javac>
</target>
????????copy?????????????build.xml????С??????飬???????????????????μ?build.properties??????????????????????????????emma.enabled=true??
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11