monkeyrunner总结

device=MonkeyRunner.waitForConnection()   //手机连接

 

result = device.takeSnapshot()    //截图

result.writeToFile("d:\dialer.png","png")   //保存在d盘 命名为dialer.png

hui=result.getSubImage((200,400,200,400))    //截取(200,400,200,400)这么大的内容

picture = MonkeyRunner.loadImageFromFile('d:\shotbegin.png','png')   //与shotbegin.png这个图片对比

hui1=picture.getSubImage((200,400,200,400))

ggg=hui.sameAs(hui1,1.0)   //对比

print ggg    //相同返回true不同返回false

posted @ 2014-11-05 15:12  阳光穿透泛白的记忆  阅读(234)  评论(1编辑  收藏  举报