uiautomation for ios introduction
DESCRIPTION
4月18日のObj-C&Xcode開発周り勉強会 - 0x01での発表資料です。 http://www.zusaar.com/event/5027005TRANSCRIPT
![Page 1: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/1.jpg)
Photograph by Simon Abrams / https://www.flickr.com/photos/flysi/183272970/
UIAutomationfor iOS
Introduction
@kuronekomichael
![Page 2: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/2.jpg)
Agenda
•1. なぜいま結合テストの自動化?•2. Instrumentsの紹介•3. 注意とアドバイス•4. これからのオートメーション
![Page 3: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/3.jpg)
なぜいま結合テストの自動化?
• ・iOSバージョン iOS5 iOS6 iOS7
• ・端末 3.5inch 4inch iPad iPod Touch..
• ・開発プロセス ウォーターフォール ↓ アジャイル
![Page 4: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/4.jpg)
•
• http://en.wikipedia.org/wiki/Iterative_and_incremental_development
![Page 5: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/5.jpg)
XCode Instruments• ・XCode付属の開発ツール• ・メモリリーク検出• ・CPUリソースの監視• ・ボトルネック検出のためのプロファイリング• ・ファイルシステムへのアクセスを監視
![Page 6: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/6.jpg)
UIAutomation• ・Instrumentsの中の一機能• ・アプリの自動テストをサポートする• ・ユーザ操作をレコーディングして JavaScriptのコードとして出力
• ・JavaScriptのコードを元に、 ユーザ操作を再現するように再生する
•
![Page 7: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/7.jpg)
Instruments
![Page 8: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/8.jpg)
![Page 9: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/9.jpg)
![Page 10: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/10.jpg)
•
/Users/<ユーザ名>/Library/Application Support/iPhone Simulator/<シミュレータのバージョン>/Applications/<アプリのバンドルID>/<アプリ名>.app
![Page 11: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/11.jpg)
![Page 12: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/12.jpg)
AppName.app
![Page 13: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/13.jpg)
AppName.app
![Page 14: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/14.jpg)
AppName.app
![Page 15: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/15.jpg)
AppName.app
![Page 16: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/16.jpg)
AppName.app
![Page 17: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/17.jpg)
スクリプトの保存
•スクリプトエリアの右クリック(セカンダリータップ)からスクリプトの保存(Export)が可能
•
![Page 18: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/18.jpg)
エディタ⇔トレース画面の切り替え AppName.app
AppName.app
![Page 19: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/19.jpg)
Photograph by Simon Abrams / https://www.flickr.com/photos/flysi/183272970/
デモdemonstration
![Page 20: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/20.jpg)
Photograph by Simon Abrams / https://www.flickr.com/photos/flysi/183272970/
注意とアドバイスattention and advice
![Page 21: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/21.jpg)
注意とアドバイス
•・操作記録は、たたき台の生成に近い 手修正がほぼ必須
• ・ログメソッドを使いこなす• UIAElement logElement()• UIAElement logElementTree()• ・日本語資料少ない• ・慣れてきたら編集<=>CLIで実行の方が スムーズかも
![Page 22: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/22.jpg)
https://gist.github.com/kuronekomichael/11032775
CLIから実行するシェルを公開してます(参考用)
![Page 23: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/23.jpg)
APIドキュメント
https://gist.github.com/kuronekomichael/11032094
APIリファレンスをざっくり日本語訳しました(怒られたら消します)
![Page 24: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/24.jpg)
Photograph by Simon Abrams / https://www.flickr.com/photos/flysi/183272970/
これからの結合テストfuture of testing
![Page 25: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/25.jpg)
http://www.w3.org/TR/webdriver/
![Page 26: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/26.jpg)
![Page 27: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/27.jpg)
appium•
![Page 28: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/28.jpg)
![Page 29: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/29.jpg)
Appium recorder
•
• https://github.com/appium/appium-dot-app
Recorderの動作がとってもイケてないので、Instrumentsからのりかえるのに躊躇してます…
![Page 30: UIAutomation for iOS Introduction](https://reader035.vdocuments.net/reader035/viewer/2022081404/557cf3e4d8b42a89158b473e/html5/thumbnails/30.jpg)
Photograph by Simon Abrams / https://www.flickr.com/photos/flysi/183272970/
thanx!御清聴ありがとうございました