android 自动化测试之Robotium 测试apk时遇到的问题
2014-01-16 16:31
731 查看
1.运行测试工程时提示:
Test run failed: Permission Denial: starting instrumentation ComponentInfo{com.example.androidcalculator.test/android.test.InstrumentationTestRunner} from pid=724, uid=724 not allowed because package com.example.androidcalculator.test does not have
a signature matching the target com.test
原因:被测程序与测试程序签名包不同,
解决方案:需要使用相同的签名文件进行签名。
2.运行测试工程时提示:
java.lang.NullPointerException****
原因:Debug查看发现 testCase的值为“null,通过反射没有传过来值”
解决方法:同样是因为因为被测程序与测试程序签名不一致导致
原因:被测程序的包名未找到,需要修改AndroidMainfest.xml的代码内容
解决方法:
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="被测程序包名" />
4.运行robotium 测试时提示“teardown 语句空指针异常”
代码:
应该修改为:
因为super在前面时他不知道要去做什么动作所以就提示为空异常
Test run failed: Permission Denial: starting instrumentation ComponentInfo{com.example.androidcalculator.test/android.test.InstrumentationTestRunner} from pid=724, uid=724 not allowed because package com.example.androidcalculator.test does not have
a signature matching the target com.test
原因:被测程序与测试程序签名包不同,
解决方案:需要使用相同的签名文件进行签名。
2.运行测试工程时提示:
java.lang.NullPointerException****
原因:Debug查看发现 testCase的值为“null,通过反射没有传过来值”
解决方法:同样是因为因为被测程序与测试程序签名不一致导致
搜索结果
3.运行测试工程时提示:
Test run failed: Unable to find instrumentation target package: com.example.action02
原因:被测程序的包名未找到,需要修改AndroidMainfest.xml的代码内容解决方法:
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="被测程序包名" />
4.运行robotium 测试时提示“teardown 语句空指针异常”
代码:
protected void tearDown() throws Exception { super.tearDown(); solo.finishOpenedActivities(); }
应该修改为:
@Override protected void tearDown() throws Exception { solo.finishOpenedActivities(); super.tearDown(); }
因为super在前面时他不知道要去做什么动作所以就提示为空异常
相关文章推荐
- 【Android自动化测试之Robotium】03. 当只有一个APK的时候使用robotium进行自动化测试
- 【Android自动化测试之Robotium】03. 当只有一个APK的时候使用robotium进行自动化测试
- 【Android自动化测试之Robotium】03. 当只有一个APK的时候使用robotium进行自动化测试
- android集成apk到系统中常遇到的一些问题
- [Android]使用 Eclipse 给 APK 签名时遇到的两个问题及解决办法
- Robotium 测试Android apk安装包
- Android自动化测试从入门到精通(Robotium自动化测试工具、架构设计、云测试应用)
- Android Robotium黑盒测试封装为Apk
- [Android] Robotium手机自动化测试(仅需apk安装包版)——环境搭建
- Android 做fragmetn回退栈测试遇到的问题
- android打包apk时混淆遇到的问题
- Android测试QQ群讨论交流内容-自动化测试Case粒度、Case耦合性、robotium和robolectric看法
- python自动化测试学习遇到的编程问题:*arg是啥,python自动化测试将测试结果写入excel中【持续更新】
- android自动化测试——robotium入门常见问题
- 重签名android apk,利用robotium进行自动化测试
- Android工程导入外部jar包时遇到的问题自动生成APK文件
- Android 自动化测试—robotium(六)只有APK存在
- [Android] Robotium手机自动化测试(仅需apk安装包版)——环境搭建
- android项目中,测试Socket连接时遇到的问题
- Android Robotium测试单个的APK方法