Android自动测试之MonkeyRunner之MonkeyImage
2013-06-21 09:28
435 查看
文章出处:/article/1445838.html
monkeyrunner类可以保存设备或模拟器的截图。MonkeyImage提供了图像转换、图像存储、复制部分图像能方法。这样可以把通过截图显性的观察问题。
MonkeyImage创建对象的方法如下:
newimage =MonkeyDevice.takeSnapshot()
MonkeyImage提供了如下方法:
http://www.devdiv.com/android/docs/guide/developing/tools/MonkeyImage.html
/**
* @author 张兴业
* 邮箱:xy-zhang@163.com
* qq:363302850
*
*/
monkeyrunner类可以保存设备或模拟器的截图。MonkeyImage提供了图像转换、图像存储、复制部分图像能方法。这样可以把通过截图显性的观察问题。
MonkeyImage创建对象的方法如下:
newimage =MonkeyDevice.takeSnapshot()
MonkeyImage提供了如下方法:
Methods | |
---|---|
string | convertToBytes (string format) Converts the current image to a particular format and returns it as a string that you can then access as aniterable of binary bytes. |
tuple | getRawPixel (integer x, integer y) Returns the single pixel at the image location (x,y), as an atuple of integer, in the form (a,r,g,b). |
integer | getRawPixelInt (integer x, integer y) Returns the single pixel at the image location (x,y), as a 32-bitinteger. |
MonkeyImage | getSubImage (tuple rect) Creates a new MonkeyImageobject from a rectangular selection of the current image. |
boolean | sameAs (MonkeyImage other, float percent) Compares this MonkeyImageobject to another and returns the result of the comparison. The percentargument specifies the percentage difference that is allowed for the two images to be "equal". |
void | writeToFile (string path, string format) Writes the current image to the file specified by filename, in the format specified by format. |
/**
* @author 张兴业
* 邮箱:xy-zhang@163.com
* qq:363302850
*
*/
相关文章推荐
- Android自动测试之monkeyrunner工具及Monkey工具
- Android自动测试之Monkey工具
- zz:Android 测试工具Monkey & Monkeyrunner 使用方法
- Android自动测试之MonkeyRunner之MonkeyDevice
- Android自动测试之monkeyrunner工具(一)
- Android自动测试之MonkeyRunner介绍
- android实用测试方法之Monkey与MonkeyRunner
- 【Monkey测试】Android自带自动测试工具monkey的使用
- Android自动测试之MonkeyRunner之MonkeyDevice
- Android自动测试之monkeyrunner工具
- 【Monkey测试】Android自带自动测试工具monkey的使用
- Android自动测试之Monkey工具
- Android自动测试之monkeyrunner工具
- Android自动化测试框架开发(二)Monkey、MonkeyRunner介绍和分析
- Android自动测试工具Monkey