Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

[Mac] automation testing technical sharing - 2013 dec

[Mac] automation testing framework - ATOMac

  • Be the first to comment

[Mac] automation testing technical sharing - 2013 dec

  1. 1. Chloe Chen - 測試開發部 ATOMac  –  GUI  Automated  Tes3ng  on  Mac    
  2. 2. •  About  Me   •  Automa+on  Tes+ng   •  ATOMac   •  System  Environment    Tools   •  Usage   •  Demo   •  Q    A   Outline
  3. 3. 陳芝媛 Chloe Chen •  經歷 •  ECS - software engineer •  KKBOX - SDET •  聯絡我 •  FB: chloe.chen.727 •  gmail: chloechen727 About Me •  個性 •  人來瘋 •  喜歡小孩
  4. 4. About Me •  個性 •  人來瘋 •  喜歡小孩
  5. 5. •  About  Me   •  Automa+on  Tes+ng   •  ATOMac   •  System  Environment    Tools   •  Usage   •  Demo   •  Q    A   Outline
  6. 6. •  Defini+on:   –  利用程式、工具取代人工進行的測試活動 Automation Testing
  7. 7. Maria, 幫我測試 1 加個 一萬次, 看有沒有問題,結果正不正確。 收到。(開始按計算機…)
  8. 8. (…+1+1+1…) Maria, 測好了嗎? (…+1+…) 還沒。 快點測好。
  9. 9. …………………
  10. 10. 忘記剛剛算到哪了啦……
  11. 11. •  Defini+on:   –  利用程式、工具取代人工進行的測試活動 •  按你千、萬遍也不厭倦、不中斷 •  Pros:    Stability  –  tested  by  program    Cost  Saving     Regression  Test     Stress  Test     Performance  Test   Automation Testing
  12. 12. •  About  Me   •  Automa+on  Tes+ng   •  ATOMac   •  System  Environment    Tools   •  Usage   •  Demo   •  Q    A   Outline
  13. 13. •  Short  for  Automated  Tes+ng  on  Mac     •  The  first  Python  GUI  tes+ng  library   •  Tes+ng  Mac  app  via.   •  Easy  to  use  to  write  tests.   ATOMac
  14. 14. •  OS  X  (10.6,  10.7,  10.8,  10.9)   •  Install  Python,  Xcode   •  Enable  Systemwide  accessibility   System  Preferences    Universal  Access    Enable  access  for  assis+ve  devices.   •  Install  ATOMac   –  sudo  easy_install  atomac   •  Op+on:  iPython,  sublime  Text  2   System Environment Tools
  15. 15. Systemwide accessibility
  16. 16. •  Use  ATOMac  to  launch  an  applica+on   •  Get  a  reference  to  the  UI  Element  in  app   •  Find  object  in  the  accessibility  hierarchy   –  Xcode  à  Open  Developer  Tools  à  Accessibility  Inspector   –  To  fix  the  target  element  :  fn  +  command  +  F7   •  Search  method   •  Control  object   Usage
  17. 17. •  Get  the  App  bundle  ID    App  Localized  Name   –  活動監視器 à  Almighty  Calculator  à  取樣程序   – Process:                  Almighty  Calculator   – Iden+fier:            com.ktpd.Calculator   Usage
  18. 18. •  Use  ATOMac  to  launch  an  applica+on   –  Import  atomac   –  atomac.launchAppByBundleId('com.ktpd.Calculator')   •  Get  a  reference  to  the  UI  Element  in  app   –  calculator  =     atomac.getAppRefByLocalizedName('Almighty  Calculator')   •  Find  object  in  the  accessibility  hierarchy   –  window  =  calculator.windows()[0]   Usage
  19. 19. Usage
  20. 20. •  Search  method   •  For  most  types  of  accessibility  objects   – sheet  =  calculator.window.sheets()[0]   •  For  UI  elements   •  FindFirst  /  FindFirstR   •  FindAll  /  FindAllR   – sheet  =  calculator.window.sheets()[0]   – equal_bugon  =  calculator.findFirstR(AXRole='AXBugon',  AXTitle='=')   Usage
  21. 21. •  Control  object   •  Get  Agribute   – equal_bugon.getAgribues()   •  Get  Ac+ons   –   equal_bugon.getAc+ons()   •  Trigger  the  ac+on   –   equal_bugon.Press()   Usage
  22. 22. •  Demo  with  ‘Almighty  Calculator’     Demo
  23. 23. Q A

  24. 24. •  Python  Automated  Tes+ng  on  Mac:    hgp://pyatom.com/   •  Source  at  Github:  hgps://github.com/pyatom/pyatom   References
  25. 25. We need you! Welcome to KKBOX!
  26. 26. THANK YOU!

×