1 / 16

Athrun Instrument Driver

Athrun Instrument Driver. 太禅. Athrun 简介. Athrun 目标:自动化手段解决无线测试的问题 定位:无线自动化测试框架 / 平台 支持: Android / iOS 口号:让手机 run 起来! Open source at. Android 框架发展历程. iOS 框架发展历程. Athrun 远程平台. IOS 框架发展(一). 注入式框架 AppFramework 思路: 利用 didFinishLaunchingWithOptions 构造控件树 模拟 touch 事件 优点: iOS 各版本适用

Download Presentation

Athrun Instrument Driver

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Athrun Instrument Driver 太禅

  2. Athrun简介 • Athrun • 目标:自动化手段解决无线测试的问题 • 定位:无线自动化测试框架/平台 • 支持:Android / iOS • 口号:让手机run起来! • Open source at

  3. Android框架发展历程

  4. iOS框架发展历程

  5. Athrun远程平台

  6. IOS框架发展(一) • 注入式框架AppFramework • 思路: • 利用didFinishLaunchingWithOptions • 构造控件树 • 模拟touch事件 • 优点: • iOS各版本适用 • Objective-C贴近开发 • 困难: • 需要修改开发代码 • 运行下个用例前,需要主动返回首页 • Objective-C对测试的学习成本

  7. IOS框架发展(二) • instrument js扩展 • UIAutomation的调研 • 优点:录制、非注入 • 缺点:iOS 4.0以上支持,操作不稳定 • 我们对UIAutomation的扩展 • 操作扩展 • 校验扩展 • Log转Hudson • UIAutomation方案的困扰 • 录制难维护 • 低级错误,排错成本高 • 无法单步调试 • 服务端数据准备

  8. IOS框架发展(三) • InstrumentDriver • 特点 • 使用java编写用例 • junit方式运行用例 • 优势 • 自动的语法检查,智能感知 • 支持断点单步调试、变量查看 • 更方便的持续集成和数据准备

  9. InstrumentDriver框架图

  10. API介绍 • API风格: • 面向UI对象 • 支持数组 • 与UIAutomation兼容 • 录制的脚本可以运行 • 根节点: • UIATarget • static localTarget() • printElementTree • scrollUp/Down/Left/Right • frontMostApp • UIAApplication • alert • keyboard • UIANavigationBar • mainWindow • win=UIATarget.localTarget().frontMostApp().mainWindow() • UIAWindow(win) • 继承自UIAElement • UIAElement • elements • T findElementByText(String text, Class<T> elmentType) • tap • touchAndHold

  11. 示例代码 @Test publicvoid Demo1() throws Exception { win.printElementTree(); win.findElementByText("Demo 1").touchAndHold(); UIAElement[] eles = win.elements(); System.out.println(eles.length); win.findElementByText("name", UIATextField.class).setValue("athrun"); win.secureTextFields()[0].tap(); app.keyboard().typeString("abcdefg\\n"); win.findElementByText("Hello Tao").tap(); assertEquals("Hello,athrun!", win.staticTexts()[3].name()); }

  12. 示例代码

  13. Demo演示 • 查看Demo • Demo-InstrumentDriver.mov

  14. 框架对比

  15. 后续发展 • Todo List • 通信超时异常处理 • Debug开关IDE自动设置 • 使用Mac共享机,在Windows上运行用例 • 开源 • http://code.taobao.org/p/athrun/wiki/index/ • Welcome To • Notify bug • Make suggestion • Send patch

More Related