关闭

Android Robotium搭建环境测试微信

发表于:2014-8-19 11:28

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:Super-John    来源:51Testing软件测试网采编

  右键该项目,选择property然后选择java build path, 选择 Add External JARs,选择下到的robotium.jar
  在跑测试用例之前,还需要修改下AndroidManifest.xml文件的android:targetPackage为被测应用的根的包名
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mitalk.test"
android:versionCode="1"
android:versionName="1.0" >
<supports-screens android:anyDensity="true" />
<uses-sdk android:targetSdkVersion="17" />
<uses-sdk android:minSdkVersion="17" />
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.tencent.mm" />
<application
android:debuggable="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<uses-library android:name="android.test.runner" />
</application>
</manifest>
  以上都弄完了,run as android junit test,就可以跑了
  备注:另外的运行方式:
Test can also be run using command prompt/terminal by following simple steps
* Write following command to install AndroidCalculator apk on emulator
> adb install <path>/AndroidCalculator.apk
* Write following command to install AndroidCalculatorTest apk on emulator
> adb install <path>/AndroidCalculatorTestApk.apk
* Run the test cases:
> adb shell am instrument -w com.testcalculator/android.test.InstrumentationTestRunner
22/2<12
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号