ios-driver
Using Selenium to automate your iOS applications
Introduction
• Technical Test Lead at Paddypower
• graham.abell@paddypower.com
• https://github.com/nicegraham
• Twitter: ...
Testing mobile solutions
• The Problem - Several iOS applications in production, more on the way
• Objective-C
• Sencha
• ...
Our wishlist
Apple’s Instruments framework
• Instruments is Apple’s iOS automation framework
• It uses the UIAutomation JS library to i...
Our wishlist
Why Selenium?
• Clean Design
• Supports any language or framework
• Stable API
• Well on it’s way to becoming a w3c standa...
ios-driver
• What is ios-driver?
• Used to drive user journeys on mobile UI
• Exposes the underlying Element Tree in a nav...
Our wishlist
Who develops ios-driver?
• Francois Reynaud (owner Grid project, Se committer)
• Graham Abell, Darragh Grace (NativeDriver...
How ios-driver works
Test Client
Java
C#
Ruby
Python
Selenium
Server
ios-driver
Instruments
WebDriver API
Writing tests – Plain old Selenium
Our wishlist
Localisation
• You can only locate elements by their content
Localisation
• Accessing the content
Localisation
• Localizing the script
Our wishlist
Element Inspection
Our wishlist
Hybrid applications
• Web content can not be automated properly with Instruments
Accessing web content in a native app
• Webkit Remote Debug Protocol provides the Webkit Web Inspector over the wire
Accessing web content in a native app
Test Client
Java
C#
Ruby
Python
Selenium
Server
ios-driver
Instruments
WKRDP
WebDriv...
Writing tests for hybrid applications
Interact via
Instruments
Switch context from native to web
Interact via
WKRDP
Web applications - Mobile Safari
Our wishlist
Let’s go faster!
Client
HubClient
CI
Selenium Grid
node
node
node
node
node
node
node
node
node
node
node
node
Selenium Grid Extras
Our wishlist
Adding Native Applications to CI
• The standard process for Selenium testing within CI
• Application is deployed by CI too...
Our Mobile Build Pipeline
• Jenkins slave running on a mac
• XCode Jenkins plugin used to
• Build app in release and debug...
Our wishlist
What’s next? – ios-driver 0.7.0 release
• New libimobiledevice integration
• Better device support, more control over real...
What’s next? – Selenium 3.0
• “a tool for user-focused automation of mobile and web apps” – Simon Stewart
• The Selenium P...
• Ios-driver
• https://github.com/ios-driver/ios-driver
• http://ios-driver.github.io/ios-driver/
• https://groups.google....
Any questions?
Upcoming SlideShare
Loading in …5
×

Ios driver presentation copy

3,195 views

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,195
On SlideShare
0
From Embeds
0
Number of Embeds
229
Actions
Shares
0
Downloads
65
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • 1)
  • ***DEMO VIDEO***http://www.youtube.com/watch?v=iOzHxpfP_dc
  • **DEMO VIDEO***http://youtu.be/G9Bsj37al78
  • Ios driver presentation copy

    1. 1. ios-driver Using Selenium to automate your iOS applications
    2. 2. Introduction • Technical Test Lead at Paddypower • graham.abell@paddypower.com • https://github.com/nicegraham • Twitter: @nicegraham • The Technical Test Team • SET – test frameworks, tools and mocking services • Performance Testing • Manage QA environments • Involved with several OSS projects
    3. 3. Testing mobile solutions • The Problem - Several iOS applications in production, more on the way • Objective-C • Sencha • Hybrid • Pure web apps • The Solution - Add automated functional testing to our CI process for mobile
    4. 4. Our wishlist
    5. 5. Apple’s Instruments framework • Instruments is Apple’s iOS automation framework • It uses the UIAutomation JS library to interact with applications • The good • Decent interface for running tests • The JS UI Automation library is extensive, well documented • Tight integration to Xcode • Does the heavy lifting of interacting with an application • The not so good • Tied to a mac for running / debugging tests • No abstraction layer to run tests • Doesn’t scale • Browsing the Element Tree [DOM] is not fun
    6. 6. Our wishlist
    7. 7. Why Selenium? • Clean Design • Supports any language or framework • Stable API • Well on it’s way to becoming a w3c standard • Already part of our framework • Minimum rework to add support for ios • The team are used to working with it • BDD used – QAs and BAs create automated scenarios • Scalability • Selenium provides Grid integration out of the box
    8. 8. ios-driver • What is ios-driver? • Used to drive user journeys on mobile UI • Exposes the underlying Element Tree in a navigable form • Implementation of Selenium API to drive iOS applications • Allows reuse of all existing Selenium infrastructure • We tried NativeDriver – Google project to solve this problem • We looked at several other projects in the space but ios-driver • Had the most interesting road map • Written in Java - suits our skills
    9. 9. Our wishlist
    10. 10. Who develops ios-driver? • Francois Reynaud (owner Grid project, Se committer) • Graham Abell, Darragh Grace (NativeDriver) • Luke Inman-Semerau (iPhoneDriver, Se committer) • Kevin Menard (Se committer) • Daniel Wagner-Hall, Micahel Klepikov (Se committer, chromedriver) • Martin Szulecki (libimobiledevice) • Jason Evans
    11. 11. How ios-driver works Test Client Java C# Ruby Python Selenium Server ios-driver Instruments WebDriver API
    12. 12. Writing tests – Plain old Selenium
    13. 13. Our wishlist
    14. 14. Localisation • You can only locate elements by their content
    15. 15. Localisation • Accessing the content
    16. 16. Localisation • Localizing the script
    17. 17. Our wishlist
    18. 18. Element Inspection
    19. 19. Our wishlist
    20. 20. Hybrid applications • Web content can not be automated properly with Instruments
    21. 21. Accessing web content in a native app • Webkit Remote Debug Protocol provides the Webkit Web Inspector over the wire
    22. 22. Accessing web content in a native app Test Client Java C# Ruby Python Selenium Server ios-driver Instruments WKRDP WebDriver API
    23. 23. Writing tests for hybrid applications Interact via Instruments Switch context from native to web Interact via WKRDP
    24. 24. Web applications - Mobile Safari
    25. 25. Our wishlist
    26. 26. Let’s go faster! Client HubClient CI Selenium Grid node node node node node node node node node node node node
    27. 27. Selenium Grid Extras
    28. 28. Our wishlist
    29. 29. Adding Native Applications to CI • The standard process for Selenium testing within CI • Application is deployed by CI tool • Tests are run via a browser • Browser versions change infrequently • Therefore • There is low volatility with registered Nodes • Traditional nodes are immutable • Native applications are different • They change on every commit • An ios-driver node handles this volatility by • Monitoring for new applications • Stops accepting new test sessions • Registers the new capability • Re-opens for business
    30. 30. Our Mobile Build Pipeline • Jenkins slave running on a mac • XCode Jenkins plugin used to • Build app in release and debug configurations • Unlocks keychain of Jenkins slave to sign app with correct Certs • Xctool used to • Run the application unit tests • Run static code analysis • Clokins plugin used to track lines of code • PMD used to detect duplicate code • GCOVR and Cobertura Jenkins plugin used for code coverage analysis • Successful builds kick off functional test with ios-driver • Testflight plugin to distribute good builds via Test Flight
    31. 31. Our wishlist
    32. 32. What’s next? – ios-driver 0.7.0 release • New libimobiledevice integration • Better device support, more control over real device state • ios-driver nodes will be able to run on windows & linux • airplay • Performance logging for MobileSafari • Will be able to generate HAR files • New inspector • Limited record and playback • iOS7 Support
    33. 33. What’s next? – Selenium 3.0 • “a tool for user-focused automation of mobile and web apps” – Simon Stewart • The Selenium Project will • Ensure as much commonality in approach as possible • Host a suite of tests to facilitate interoperability • Add extensions to W3C
    34. 34. • Ios-driver • https://github.com/ios-driver/ios-driver • http://ios-driver.github.io/ios-driver/ • https://groups.google.com/forum/#!forum/ios-driver • #ios-driver on freenode irc tends to be the best place for help • Selenium Grid Extras • https://github.com/nicegraham/Selenium-Grid-Extras • Selenium 3 • http://seleniumhq.wordpress.com/2013/08/28/the-road-to-selenium-3/ • Jenkins • https://github.com/facebook/xctool • http://jenkins.quiedeville.org/job/Clokins/ • http://pmd.sourceforge.net/ • https://github.com/gcovr/gcovr • https://www.testflightapp.com Links
    35. 35. Any questions?

    ×