| Version 4 (modified by liaojiaohe, 11 years ago) (diff) |
|---|
参考文章: http://www.360doc.com/content/14/0213/16/7044580_352233197.shtml
Instrumentation类: http://developer.android.com/reference/android/app/Instrumentation.html
Android APIs提供
UI层的自动化
跨进程受到android进程安全限制
扩展后的框架:Robotium, Athrun等
Monkeyrunner http://developer.android.com/tools/help/MonkeyRunner.html
Android SDK提供
python脚本,使用monkeyrunner test.py来执行
结果的验证是通过截屏比对图片来实现,验证方式不够灵活
UIAutomator: http://developer.android.com/tools/help/uiautomator/index.html
Android提供的框架,支持SDK level 16及以上
打包成jar后push到模拟器中运行,调试相对Robotium不便(其实自己稍微封装下也还OK)
支持跨进程测试!!!
Robotium:http://code.google.com/p/robotium/
基于instrumentation实现,提供的接口可以满足大部分自动化需求,使用方法简单
支持手势、webview、截图等操作
支持Remote Control方式
支持ant、maven打包,与jenkins结合较好
资料丰富,社区活跃,更新频繁
签名问题,待测App和测试App必须使用相同签名
通过solo对象提供操作方法,面向对象方面较差
不支持跨应用测试,Android进程安全限制
gradle配置
- 使用gradle新版测试的缺省目录是 androidTest
- 有些类比如ApplicationTestCase在API 17出现,所以编译的API要是用17以后的
Attachments
-
ActivityInstrumentation.zip
(130.0 KB) -
added by liaojiaohe 11 years ago.
-
ExampleTestProject_v5.2.1.zip
(808.8 KB) -
added by liaojiaohe 11 years ago.
![(please configure the [header_logo] section in trac.ini)](http://www1.pconline.com.cn/hr/2009/global/images/logo.gif)