SlideShare uma empresa Scribd logo
1 de 16
Baixar para ler offline
Athrun Instrument Driver

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



• Open source at
  –
Android框架发展历程


        录制

   流程
   构建
         自动化
          框架
iOS框架发展历程



                     Instrument
                     Driver
        instrument
        js 扩展

注入式框架
Athrun远程平台
IOS框架发展(一)
• 注入式框架AppFramework
 – 思路:
   • 利用didFinishLaunchingWithOptions
   • 构造控件树
   • 模拟touch事件
 – 优点:
   • iOS各版本适用
   • Objective-C贴近开发
 – 困难:
   • 需要修改开发代码
   • 运行下个用例前,需要主动返回首页
   • Objective-C对测试的学习成本
IOS框架发展(二)
• instrument js 扩展
  – UIAutomation的调研
    • 优点:录制、非注入
    • 缺点:iOS 4.0以上支持,操作不稳定
  – 我们对UIAutomation的扩展
    • 操作扩展
    • 校验扩展
    • Log转Hudson
  – UIAutomation方案的困扰
    •   录制难维护
    •   低级错误,排错成本高
    •   无法单步调试
    •   服务端数据准备
IOS框架发展(三)
• InstrumentDriver
  – 特点
    • 使用java编写用例
    • junit方式运行用例
  – 优势
    • 自动的语法检查,智能感知
    • 支持断点单步调试、变量查看
    • 更方便的持续集成和数据准备
InstrumentDriver 框架图
API介绍
• API风格:                              •   alert
                                      •   keyboard
 –   面向UI对象
                                      •   UIANavigationBar
 –   支持数组                             •   mainWindow
 –   与UIAutomation兼容                  •   win=UIATarget.localTarget().f
 –   录制的脚本可以运行                            rontMostApp().mainWindow()
                                    – UIAWindow(win)
• 根节点:
                                      • 继承自UIAElement
 – UIATarget
                                    – UIAElement
     •   static localTarget()
                                      • elements
     •   printElementTree
                                      • T findElementByText(String
     •   scrollUp/Down/Left/Right       text, Class<T> elmentType)
     •   frontMostApp                 • tap
 – UIAApplication                     • touchAndHold
示例代码
@Test
public void 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("abcdefgn");
  win.findElementByText("Hello Tao").tap();
  assertEquals("Hello,athrun!", win.staticTexts()[3].name());
}
示例代码
Demo演示
• 查看Demo
 – Demo-InstrumentDriver.mov
框架对比
                          Instrument       UI        Fone         iOS
     Feature List
                             Driver    Automation   Monkey    NativeDriver
Open Source                    ●              -        ●           ●
Depends On                Instrument   Instrument    Inject      inject
OS Version                   > iOS4       > iOS4       All         All
Test Script Language       Java/Any          js       UI/js       Any
OO style API Design            ●            ●          ●           ●
Test Release APP               ●            ●           -           -
WebView Automation             ●            ●          ●           ●
Continuous Integration         ●            ●          ●           ●
Remote Control                 ●              -         -          ●
Record And Playback            ○            ●          ●            -
Server Data Preparation        ●              -         -          ●
Debug while running            ●              -         -          ●
Embedded Data-Driven            -             -        ●            -
后续发展
• Todo List
  – 通信超时异常处理
  – Debug开关IDE自动设置
  – 使用Mac共享机,在Windows上运行用例
• 开源
  – http://code.taobao.org/p/athrun/wiki/index/
  – Welcome To
     • Notify bug
     • Make suggestion
     • Send patch
Athrun instrument driver

Mais conteúdo relacionado

Destaque

Soundararajan arthurbalci agile2012_handout_v1_0
Soundararajan arthurbalci agile2012_handout_v1_0Soundararajan arthurbalci agile2012_handout_v1_0
Soundararajan arthurbalci agile2012_handout_v1_0drewz lin
 
敏捷模式下的百度研发基础环境建设 1
敏捷模式下的百度研发基础环境建设 1敏捷模式下的百度研发基础环境建设 1
敏捷模式下的百度研发基础环境建设 1drewz lin
 
Hands onagile2012shared
Hands onagile2012sharedHands onagile2012shared
Hands onagile2012shareddrewz lin
 
豆瓣I os自动化测试实践和经验
豆瓣I os自动化测试实践和经验豆瓣I os自动化测试实践和经验
豆瓣I os自动化测试实践和经验drewz lin
 
Top100summit 互联网发布与实验体系建设
Top100summit 互联网发布与实验体系建设 Top100summit 互联网发布与实验体系建设
Top100summit 互联网发布与实验体系建设 drewz lin
 
15 ma cs and signatures
15   ma cs and signatures15   ma cs and signatures
15 ma cs and signaturesdrewz lin
 
Simple methods for_reliable_user_involvement
Simple methods for_reliable_user_involvementSimple methods for_reliable_user_involvement
Simple methods for_reliable_user_involvementdrewz lin
 
Tcpcopy 阿里技术沙龙
Tcpcopy 阿里技术沙龙Tcpcopy 阿里技术沙龙
Tcpcopy 阿里技术沙龙drewz lin
 
Scaling scrum-mega-framework
Scaling scrum-mega-frameworkScaling scrum-mega-framework
Scaling scrum-mega-frameworkdrewz lin
 
9 password security
9   password security9   password security
9 password securitydrewz lin
 
大规模网站架构
大规模网站架构大规模网站架构
大规模网站架构drewz lin
 
Agile 2012 - leadership agility workshop slides -- final.pptx
Agile 2012  - leadership agility workshop slides -- final.pptxAgile 2012  - leadership agility workshop slides -- final.pptx
Agile 2012 - leadership agility workshop slides -- final.pptxdrewz lin
 
13 asymmetric key cryptography
13   asymmetric key cryptography13   asymmetric key cryptography
13 asymmetric key cryptographydrewz lin
 

Destaque (13)

Soundararajan arthurbalci agile2012_handout_v1_0
Soundararajan arthurbalci agile2012_handout_v1_0Soundararajan arthurbalci agile2012_handout_v1_0
Soundararajan arthurbalci agile2012_handout_v1_0
 
敏捷模式下的百度研发基础环境建设 1
敏捷模式下的百度研发基础环境建设 1敏捷模式下的百度研发基础环境建设 1
敏捷模式下的百度研发基础环境建设 1
 
Hands onagile2012shared
Hands onagile2012sharedHands onagile2012shared
Hands onagile2012shared
 
豆瓣I os自动化测试实践和经验
豆瓣I os自动化测试实践和经验豆瓣I os自动化测试实践和经验
豆瓣I os自动化测试实践和经验
 
Top100summit 互联网发布与实验体系建设
Top100summit 互联网发布与实验体系建设 Top100summit 互联网发布与实验体系建设
Top100summit 互联网发布与实验体系建设
 
15 ma cs and signatures
15   ma cs and signatures15   ma cs and signatures
15 ma cs and signatures
 
Simple methods for_reliable_user_involvement
Simple methods for_reliable_user_involvementSimple methods for_reliable_user_involvement
Simple methods for_reliable_user_involvement
 
Tcpcopy 阿里技术沙龙
Tcpcopy 阿里技术沙龙Tcpcopy 阿里技术沙龙
Tcpcopy 阿里技术沙龙
 
Scaling scrum-mega-framework
Scaling scrum-mega-frameworkScaling scrum-mega-framework
Scaling scrum-mega-framework
 
9 password security
9   password security9   password security
9 password security
 
大规模网站架构
大规模网站架构大规模网站架构
大规模网站架构
 
Agile 2012 - leadership agility workshop slides -- final.pptx
Agile 2012  - leadership agility workshop slides -- final.pptxAgile 2012  - leadership agility workshop slides -- final.pptx
Agile 2012 - leadership agility workshop slides -- final.pptx
 
13 asymmetric key cryptography
13   asymmetric key cryptography13   asymmetric key cryptography
13 asymmetric key cryptography
 

Semelhante a Athrun instrument driver

测试驱动的前端开发初探
测试驱动的前端开发初探测试驱动的前端开发初探
测试驱动的前端开发初探hua qiu
 
Test driven-frontend-develop
Test driven-frontend-developTest driven-frontend-develop
Test driven-frontend-developfangdeng
 
Appium手机自动化测试 testerhome_bqcon版本
Appium手机自动化测试 testerhome_bqcon版本Appium手机自动化测试 testerhome_bqcon版本
Appium手机自动化测试 testerhome_bqcon版本延胜 黄
 
Appcan介绍自己的应用开发平台
Appcan介绍自己的应用开发平台Appcan介绍自己的应用开发平台
Appcan介绍自己的应用开发平台MOBINODE
 
美团前端架构简介
美团前端架构简介美团前端架构简介
美团前端架构简介pan weizeng
 
Continuous integration
Continuous integrationContinuous integration
Continuous integrationnetdbncku
 
广告技术部自动化测试介绍.pdf
广告技术部自动化测试介绍.pdf广告技术部自动化测试介绍.pdf
广告技术部自动化测试介绍.pdfbj_qa
 
Appcan平台介绍
Appcan平台介绍Appcan平台介绍
Appcan平台介绍36Kr.com
 
使用 Pytest 進行單元測試 (PyCon TW 2021)
使用 Pytest 進行單元測試 (PyCon TW 2021)使用 Pytest 進行單元測試 (PyCon TW 2021)
使用 Pytest 進行單元測試 (PyCon TW 2021)Max Lai
 
一步一步开发Html5 mobile apps
一步一步开发Html5 mobile apps一步一步开发Html5 mobile apps
一步一步开发Html5 mobile appsAdam Lu
 
Java 1(Java概述)
Java 1(Java概述)Java 1(Java概述)
Java 1(Java概述)xzdbd
 
Foundation of software development 1
Foundation of software development 1Foundation of software development 1
Foundation of software development 1netdbncku
 
開放原始碼 Ch3.1 mobile - oss - oss行動領域-1 (ver1.0)
開放原始碼 Ch3.1  mobile - oss - oss行動領域-1 (ver1.0) 開放原始碼 Ch3.1  mobile - oss - oss行動領域-1 (ver1.0)
開放原始碼 Ch3.1 mobile - oss - oss行動領域-1 (ver1.0) My own sweet home!
 
Appcan移动应用开发平台介绍120409
Appcan移动应用开发平台介绍120409Appcan移动应用开发平台介绍120409
Appcan移动应用开发平台介绍120409zhengyiwuxian
 
Nodejs & NAE
Nodejs & NAENodejs & NAE
Nodejs & NAEq3boy
 
分会场九Windows 7迁移最佳实践
分会场九Windows 7迁移最佳实践分会场九Windows 7迁移最佳实践
分会场九Windows 7迁移最佳实践ITband
 
初窺 Flutter 開發.pdf
初窺 Flutter 開發.pdf初窺 Flutter 開發.pdf
初窺 Flutter 開發.pdfgdscnycu
 
使用 Visual Studio Code 建構 JavaScript 應用程式
使用 Visual Studio Code 建構 JavaScript 應用程式使用 Visual Studio Code 建構 JavaScript 應用程式
使用 Visual Studio Code 建構 JavaScript 應用程式Will Huang
 

Semelhante a Athrun instrument driver (20)

测试驱动的前端开发初探
测试驱动的前端开发初探测试驱动的前端开发初探
测试驱动的前端开发初探
 
Test driven-frontend-develop
Test driven-frontend-developTest driven-frontend-develop
Test driven-frontend-develop
 
Android工作坊
Android工作坊Android工作坊
Android工作坊
 
Appium手机自动化测试 testerhome_bqcon版本
Appium手机自动化测试 testerhome_bqcon版本Appium手机自动化测试 testerhome_bqcon版本
Appium手机自动化测试 testerhome_bqcon版本
 
Appcan介绍自己的应用开发平台
Appcan介绍自己的应用开发平台Appcan介绍自己的应用开发平台
Appcan介绍自己的应用开发平台
 
美团前端架构简介
美团前端架构简介美团前端架构简介
美团前端架构简介
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
广告技术部自动化测试介绍.pdf
广告技术部自动化测试介绍.pdf广告技术部自动化测试介绍.pdf
广告技术部自动化测试介绍.pdf
 
Appcan平台介绍
Appcan平台介绍Appcan平台介绍
Appcan平台介绍
 
Android labs part1
Android labs part1Android labs part1
Android labs part1
 
使用 Pytest 進行單元測試 (PyCon TW 2021)
使用 Pytest 進行單元測試 (PyCon TW 2021)使用 Pytest 進行單元測試 (PyCon TW 2021)
使用 Pytest 進行單元測試 (PyCon TW 2021)
 
一步一步开发Html5 mobile apps
一步一步开发Html5 mobile apps一步一步开发Html5 mobile apps
一步一步开发Html5 mobile apps
 
Java 1(Java概述)
Java 1(Java概述)Java 1(Java概述)
Java 1(Java概述)
 
Foundation of software development 1
Foundation of software development 1Foundation of software development 1
Foundation of software development 1
 
開放原始碼 Ch3.1 mobile - oss - oss行動領域-1 (ver1.0)
開放原始碼 Ch3.1  mobile - oss - oss行動領域-1 (ver1.0) 開放原始碼 Ch3.1  mobile - oss - oss行動領域-1 (ver1.0)
開放原始碼 Ch3.1 mobile - oss - oss行動領域-1 (ver1.0)
 
Appcan移动应用开发平台介绍120409
Appcan移动应用开发平台介绍120409Appcan移动应用开发平台介绍120409
Appcan移动应用开发平台介绍120409
 
Nodejs & NAE
Nodejs & NAENodejs & NAE
Nodejs & NAE
 
分会场九Windows 7迁移最佳实践
分会场九Windows 7迁移最佳实践分会场九Windows 7迁移最佳实践
分会场九Windows 7迁移最佳实践
 
初窺 Flutter 開發.pdf
初窺 Flutter 開發.pdf初窺 Flutter 開發.pdf
初窺 Flutter 開發.pdf
 
使用 Visual Studio Code 建構 JavaScript 應用程式
使用 Visual Studio Code 建構 JavaScript 應用程式使用 Visual Studio Code 建構 JavaScript 應用程式
使用 Visual Studio Code 建構 JavaScript 應用程式
 

Mais de drewz lin

Web security-–-everything-we-know-is-wrong-eoin-keary
Web security-–-everything-we-know-is-wrong-eoin-kearyWeb security-–-everything-we-know-is-wrong-eoin-keary
Web security-–-everything-we-know-is-wrong-eoin-kearydrewz lin
 
Via forensics appsecusa-nov-2013
Via forensics appsecusa-nov-2013Via forensics appsecusa-nov-2013
Via forensics appsecusa-nov-2013drewz lin
 
Phu appsec13
Phu appsec13Phu appsec13
Phu appsec13drewz lin
 
Owasp2013 johannesullrich
Owasp2013 johannesullrichOwasp2013 johannesullrich
Owasp2013 johannesullrichdrewz lin
 
Owasp advanced mobile-application-code-review-techniques-v0.2
Owasp advanced mobile-application-code-review-techniques-v0.2Owasp advanced mobile-application-code-review-techniques-v0.2
Owasp advanced mobile-application-code-review-techniques-v0.2drewz lin
 
I mas appsecusa-nov13-v2
I mas appsecusa-nov13-v2I mas appsecusa-nov13-v2
I mas appsecusa-nov13-v2drewz lin
 
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolfDefeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolfdrewz lin
 
Csrf not-all-defenses-are-created-equal
Csrf not-all-defenses-are-created-equalCsrf not-all-defenses-are-created-equal
Csrf not-all-defenses-are-created-equaldrewz lin
 
Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21
Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21
Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21drewz lin
 
Appsec usa roberthansen
Appsec usa roberthansenAppsec usa roberthansen
Appsec usa roberthansendrewz lin
 
Appsec usa2013 js_libinsecurity_stefanodipaola
Appsec usa2013 js_libinsecurity_stefanodipaolaAppsec usa2013 js_libinsecurity_stefanodipaola
Appsec usa2013 js_libinsecurity_stefanodipaoladrewz lin
 
Appsec2013 presentation-dickson final-with_all_final_edits
Appsec2013 presentation-dickson final-with_all_final_editsAppsec2013 presentation-dickson final-with_all_final_edits
Appsec2013 presentation-dickson final-with_all_final_editsdrewz lin
 
Appsec2013 presentation
Appsec2013 presentationAppsec2013 presentation
Appsec2013 presentationdrewz lin
 
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitationsAppsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitationsdrewz lin
 
Appsec2013 assurance tagging-robert martin
Appsec2013 assurance tagging-robert martinAppsec2013 assurance tagging-robert martin
Appsec2013 assurance tagging-robert martindrewz lin
 
Amol scadaowasp
Amol scadaowaspAmol scadaowasp
Amol scadaowaspdrewz lin
 
Agile sdlc-v1.1-owasp-app sec-usa
Agile sdlc-v1.1-owasp-app sec-usaAgile sdlc-v1.1-owasp-app sec-usa
Agile sdlc-v1.1-owasp-app sec-usadrewz lin
 
Vulnex app secusa2013
Vulnex app secusa2013Vulnex app secusa2013
Vulnex app secusa2013drewz lin
 
基于虚拟化技术的分布式软件测试框架
基于虚拟化技术的分布式软件测试框架基于虚拟化技术的分布式软件测试框架
基于虚拟化技术的分布式软件测试框架drewz lin
 
新浪微博稳定性经验谈
新浪微博稳定性经验谈新浪微博稳定性经验谈
新浪微博稳定性经验谈drewz lin
 

Mais de drewz lin (20)

Web security-–-everything-we-know-is-wrong-eoin-keary
Web security-–-everything-we-know-is-wrong-eoin-kearyWeb security-–-everything-we-know-is-wrong-eoin-keary
Web security-–-everything-we-know-is-wrong-eoin-keary
 
Via forensics appsecusa-nov-2013
Via forensics appsecusa-nov-2013Via forensics appsecusa-nov-2013
Via forensics appsecusa-nov-2013
 
Phu appsec13
Phu appsec13Phu appsec13
Phu appsec13
 
Owasp2013 johannesullrich
Owasp2013 johannesullrichOwasp2013 johannesullrich
Owasp2013 johannesullrich
 
Owasp advanced mobile-application-code-review-techniques-v0.2
Owasp advanced mobile-application-code-review-techniques-v0.2Owasp advanced mobile-application-code-review-techniques-v0.2
Owasp advanced mobile-application-code-review-techniques-v0.2
 
I mas appsecusa-nov13-v2
I mas appsecusa-nov13-v2I mas appsecusa-nov13-v2
I mas appsecusa-nov13-v2
 
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolfDefeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
 
Csrf not-all-defenses-are-created-equal
Csrf not-all-defenses-are-created-equalCsrf not-all-defenses-are-created-equal
Csrf not-all-defenses-are-created-equal
 
Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21
Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21
Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21
 
Appsec usa roberthansen
Appsec usa roberthansenAppsec usa roberthansen
Appsec usa roberthansen
 
Appsec usa2013 js_libinsecurity_stefanodipaola
Appsec usa2013 js_libinsecurity_stefanodipaolaAppsec usa2013 js_libinsecurity_stefanodipaola
Appsec usa2013 js_libinsecurity_stefanodipaola
 
Appsec2013 presentation-dickson final-with_all_final_edits
Appsec2013 presentation-dickson final-with_all_final_editsAppsec2013 presentation-dickson final-with_all_final_edits
Appsec2013 presentation-dickson final-with_all_final_edits
 
Appsec2013 presentation
Appsec2013 presentationAppsec2013 presentation
Appsec2013 presentation
 
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitationsAppsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
 
Appsec2013 assurance tagging-robert martin
Appsec2013 assurance tagging-robert martinAppsec2013 assurance tagging-robert martin
Appsec2013 assurance tagging-robert martin
 
Amol scadaowasp
Amol scadaowaspAmol scadaowasp
Amol scadaowasp
 
Agile sdlc-v1.1-owasp-app sec-usa
Agile sdlc-v1.1-owasp-app sec-usaAgile sdlc-v1.1-owasp-app sec-usa
Agile sdlc-v1.1-owasp-app sec-usa
 
Vulnex app secusa2013
Vulnex app secusa2013Vulnex app secusa2013
Vulnex app secusa2013
 
基于虚拟化技术的分布式软件测试框架
基于虚拟化技术的分布式软件测试框架基于虚拟化技术的分布式软件测试框架
基于虚拟化技术的分布式软件测试框架
 
新浪微博稳定性经验谈
新浪微博稳定性经验谈新浪微博稳定性经验谈
新浪微博稳定性经验谈
 

Athrun instrument driver

  • 2. Athrun简介 • Athrun – 目标:自动化手段解决无线测试的问题 – 定位:无线自动化测试框架/平台 – 支持:Android / iOS – 口号:让手机run起来! • Open source at –
  • 3. Android框架发展历程 录制 流程 构建 自动化 框架
  • 4. iOS框架发展历程 Instrument Driver instrument js 扩展 注入式框架
  • 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方式运行用例 – 优势 • 自动的语法检查,智能感知 • 支持断点单步调试、变量查看 • 更方便的持续集成和数据准备
  • 10. API介绍 • API风格: • alert • keyboard – 面向UI对象 • UIANavigationBar – 支持数组 • mainWindow – 与UIAutomation兼容 • win=UIATarget.localTarget().f – 录制的脚本可以运行 rontMostApp().mainWindow() – UIAWindow(win) • 根节点: • 继承自UIAElement – UIATarget – UIAElement • static localTarget() • elements • printElementTree • T findElementByText(String • scrollUp/Down/Left/Right text, Class<T> elmentType) • frontMostApp • tap – UIAApplication • touchAndHold
  • 11. 示例代码 @Test public void 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("abcdefgn"); win.findElementByText("Hello Tao").tap(); assertEquals("Hello,athrun!", win.staticTexts()[3].name()); }
  • 13. Demo演示 • 查看Demo – Demo-InstrumentDriver.mov
  • 14. 框架对比 Instrument UI Fone iOS Feature List Driver Automation Monkey NativeDriver Open Source ● - ● ● Depends On Instrument Instrument Inject inject OS Version > iOS4 > iOS4 All All Test Script Language Java/Any js UI/js Any OO style API Design ● ● ● ● Test Release APP ● ● - - WebView Automation ● ● ● ● Continuous Integration ● ● ● ● Remote Control ● - - ● Record And Playback ○ ● ● - Server Data Preparation ● - - ● Debug while running ● - - ● Embedded Data-Driven - - ● -
  • 15. 后续发展 • Todo List – 通信超时异常处理 – Debug开关IDE自动设置 – 使用Mac共享机,在Windows上运行用例 • 开源 – http://code.taobao.org/p/athrun/wiki/index/ – Welcome To • Notify bug • Make suggestion • Send patch