从事android客户端测试。微博:http://weibo.com/xingzunxi

Robotium截图

上一篇 / 下一篇  2013-05-03 10:46:00 / 个人分类:Robotium

最近开始学习Robotium,Robotium是一个测试android的自动化工具。
昨天学习使用了一下Robotium的截屏功能。
函数如下:

takeScreenshot

public voidtakeScreenshot()
Takes a screenshot and saves it in "/sdcard/Robotium-Screenshots/". Requires write permission (android.permission.WRITE_EXTERNAL_STORAGE) in AndroidManifest.xml of the application under test.

当时自己写的时候认为比较简单,没有仔细看API,忘记在Manifest里面增加权限了。
注意是在被测试应用中增加此权限。
举例如下:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>


TAG:

 

评分:0

我来说两句

Open Toolbar