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.

Automation With Frank


Published on

I designed my presentation around 3 main question that needed an answer: What, Why, How.

Frank is a tool for UI automation testing of iOS and Mac apps. it also includes a neat app inspector, called Symbiote.

He is quite old in the market, has been around for 2 years or so. When it was launched Frank extended KIF, another framework with the same purpose. Meanwhile Apple made their framework, PublicAutomation, available for free, so Pete Hodgson (the creator of Frank) switched to it. Basically with Frank, you get the power of Apple and the possibility to adapt it to your needs.

Alternatives to Frank:

UIAutomation – restrictive (included in Instruments from Xcode)
KIF – was extended by Frank
Calabash - for full power you must use Xamarin, which is not free
EggPlant – accesses your application over remote control, which is pretty neat, but unfortunately is not free.
Appium – a good option too, especially if you have a cross platform application

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Automation With Frank

  1. 1. Presentation Highlights: ● What is Frank ● Why Frank ● How to use Frank ● Conclusions ● Q&A
  2. 2. What is Frank? ● Basic 'Selenium for native iOS apps'. ● Write automated acceptance tests ● Verify the functionality of native iOS apps. ● Symbiote - a powerful “app inspector”
  3. 3. Why: Advantages • Easy Setup - less than 10 minutes. • Record Video - of the test runs to show the app in action • Run everywhere - has support for Simulator and Device • Integrates with CI - run on every check in • Great Community - strong, helpful community Google Group
  4. 4. Disadvantages • Doesn’t support Record and Play • Improvements based usually only on community requests • Lack of documentation
  5. 5. Frank Architecture
  6. 6. Communication • Frankly - simple HTTP-based wire protocol. • GET and POST requests • Request and response bodies contain JSON
  7. 7. Response Format • Responses may either be standard or non-standard. • A standard response always conforms to a format similar to: { 'outcome': 'SUCCESS', 'results': ['foo','bar'] } indicating a failure format: { 'outcome': 'ERROR', 'reason': 'Failed to frob the flib', 'detail': 'Flange capacitator decoupled' } • Non-standard responses will be valid JSON documents
  8. 8. Frank Server • Written in objective-C • Compiled into the automated iOS application • Provides responses to the Driver
  9. 9. Frank Driver • Cucumber Driver - implemented in ruby • Shelley - a selector engine to access a subset of UI elements. • Create additional drivers rewriting frank_helpers.rb • Frank helpers - a core set of helper functions
  10. 10. How to use Frank • Designed to work with Cucumber. • Can be adapted to other languages too. • Examples: Cucumber and Java. turn on the accessibility features on the machine hosting your iOS simulator. Go to System Preferences -> Universal Access and Check “Enable access for assistive devices”.
  11. 11. Frankify the app • the process of adding a separate Frank target to your app • has the Frank server embedded into it • allowing it to respond to automation commands. Frankified application Application Frank Server
  12. 12. Frankify the app • install the frank-cucumber gem by running: sudo gem install frank-cucumber (run this into the project's root directory – the one with the .xcodeproj file) • create the Frank subdirectory which contains everything necessary to Frankify you app by running frank setup
  13. 13. Frankify the app • create a Frankified version of you app by running: frank build • launch the Frankified app in the simulator by running: frank launch • check that you are indeed running a Frankified version by running: frank inspect
  14. 14. Symbiote ● creates a tree structure with the UI Elements from you app. ● must have the app running in the simulator. ● the application should be exactly on the same screen as Symbiote, for it to work. ● when investigating a different screen, the browser must be refreshed. ● access it from browser at http://localhost:37265/
  15. 15. Shelley ● Symbiote uses Shelley to access the UI Elements via queries. ● Verify if an element is accessible from browser using a query that should have the final result highlighting the desired element. ● Examples of queries: ○ view:'UILabel' marked:'Saved Tabs' parent view:'TableViewCell' ○ button:"UIButton" marked:'btn plus' index:0
  16. 16. Frank using Cucumber • Cucumber - a tool that executes plain-text functional descriptions as automated tests. • Gherkin – the language that Cucumber understands. – Business Readable, Domain Specific Language – serves two purposes — documentation and automated tests.
  17. 17. Speaking the same language • Cucumber supports over 40 spoken languages • Listing the available languages: cucumber --i18n help Ahoy! me buckos
  18. 18. Example Feature: Navigating between screens Scenario: Moving from the 'Home' screen to the 'Events' screen and navigate through it Given I launch the app When I navigate to "Events" Then I should be on the Events screen When I navigate Events to "Count Down" Then I should be on the Count Down screen
  19. 19. Conclusions • Open source tool for automation testing against iOS apps • Adaptable to one’s needs • Uses the power provided by Apple’s framework • Great community that provides support
  20. 20. Bibliography • The Official Website: • The GitHub Repository: moredip/Frank • Pete Hodgson’s Blog: Being Agile • Google Group: Frank • Frank Helpers:
  21. 21. Thank you! email: