Robotium是一款国外的Android自动化测试框架,主要针对Android平台的应用进行黑盒自动化测试,它提供了模拟各种手势操作(点击、长按、滑动等)、查找和断言机制的API,能够对各种控件进行操作。Robotium结合Android官方提供的测试框架达到对应用程序进行自动化的测试。另外,Robotium 4.0版本已经支持对WebView的操作。Robotium 对Activity,Dialog,Toast,Menu 都是支持的。

外文名

Robotium

属于

Android自动化测试框架

用于

进行黑盒自动化测试

支持

Activity,Dialog,Toast,Menu

优点

The Good:

·Easy to use

·Tests are easy to read

·Doesn't require access to source code. Can test a APK

·Can identify elements easily (with caveat...more on this later) ·Can fall back on default Android framework ·Great support

缺点

The Bad :

·Not all views and objects are currently supported e.g. SlidingDrawer

·Slower compared to unit testing

·Single class containing all methods, Selenium 1 style. This is going to get messy :)

用法

Robotium的用法很简单,同时也是很有效的黑盒测试工具。我们在使用时通过Solo对象的实例,可以创建丰富的测试用例。Solo不仅对activity支持,对Toast,Menu,Dialog也是支持的。Solo的更多用法请参考javadoc文档

目前国内有几名爱好自动化测试的人员建立了中文站点,定期发表一些使用教程、案例、以及API翻译。