android自动化测试工具【UiAutomator】——截图功能
2014-05-21 14:13
513 查看
本文主要介绍如何使用takeScreenshot来进行屏幕截图,仅供参考。
以下为主要代码段
// Simulate a short press on the HOME button.
getUiDevice().pressHome() ;
sleep(1000) ;
//创建文件
File f = new File("/data/local/tmp/Screenshot.png") ;
System.out.println(getUiDevice().takeScreenshot(new File("/mnt/sdcard/Screenshot.png") , 0, 50)) ;
sleep(2000) ;
以下为主要代码段
// Simulate a short press on the HOME button.
getUiDevice().pressHome() ;
sleep(1000) ;
//创建文件
File f = new File("/data/local/tmp/Screenshot.png") ;
System.out.println(getUiDevice().takeScreenshot(new File("/mnt/sdcard/Screenshot.png") , 0, 50)) ;
sleep(2000) ;
相关文章推荐
- UiAutomator——Android自动化测试工具简要介绍
- android自动化测试工具【UiAutomator】——使用Indec来定位控件
- Android自动化测试工具uiautomator
- android自动化测试工具【UiAutomator】——打开settings实例
- android自动化测试工具【UiAutomator】——UiWatcher(一)
- Android自动化测试工具 UiAutomator使用详解
- android自动化测试工具【UiAutomator】——UiScrollable
- android自动化测试工具【UiAutomator】——UiObject
- android自动化测试工具【UiAutomator】——打开settings实例
- 在Macbook上配置使用Android自动化测试工具uiautomator
- Android自动化测试工具——Monkey
- android自动化测试工具---monkeyrunner工具
- android界面自动化测试工具monkeyrunner
- Android自动化压力测试图解教程——Monkey工具
- iOS_ MonkeyTalk(1)(iOS与android的自动化测试工具)
- 转:Android自动化压力测试工具Monkey——测试例子
- android自动化测试工具之DroidPilot
- TIB自动化测试工作室研发的手机自动化测试工具 - Android Robot
- Android自动化测试工具——robotium