为什么需要快速调试?
- uiautomator无法在Eclipse直接调试
- 命令行调试效率低下
进行快速调试步骤
- 打开https://github.com/fan2597/UiAutomatorHelper
- 下载项目
- 将UiAutomatorHelper.java拷贝到测试工程下
-
新建java main方法,填写如下代码
public static void main(String[] args) { String jarName, testClass, testName, androidId; jarName = "Demo"; testClass = "com.learn.test.uiautomator.Test"; testName = "testPressHome"; androidId = "3"; new UiAutomatorHelper(jarName, testClass, testName, androidId); }
- Run as -> Java Application即可
实质就是把调试步骤转换成响应的脚本执行
创建build文件 -> 修改build文件 -> 开始编译 -> push文件 -> 运行测试
本文介绍了一种通过UiAutomatorHelper工具实现快速调试UiAutomator的方法,解决了Eclipse下无法直接调试及命令行调试效率低的问题。文章详细介绍了如何下载、配置并使用UiAutomatorHelper,以及如何通过编写简单的Java代码实现自动化测试流程。
1609

被折叠的 条评论
为什么被折叠?



