automation with frank
DESCRIPTION
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 applicationTRANSCRIPT
![Page 1: Automation With Frank](https://reader036.vdocument.in/reader036/viewer/2022062616/5492973fb47959424d8b4647/html5/thumbnails/1.jpg)
![Page 2: Automation With Frank](https://reader036.vdocument.in/reader036/viewer/2022062616/5492973fb47959424d8b4647/html5/thumbnails/2.jpg)
Presentation Highlights:
●What is Frank●Why Frank●How to use Frank●Conclusions●Q&A
![Page 3: Automation With Frank](https://reader036.vdocument.in/reader036/viewer/2022062616/5492973fb47959424d8b4647/html5/thumbnails/3.jpg)
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”
![Page 4: Automation With Frank](https://reader036.vdocument.in/reader036/viewer/2022062616/5492973fb47959424d8b4647/html5/thumbnails/4.jpg)
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
![Page 5: Automation With Frank](https://reader036.vdocument.in/reader036/viewer/2022062616/5492973fb47959424d8b4647/html5/thumbnails/5.jpg)
Disadvantages
• Doesn’t support Record and Play
• Improvements based usually only on community requests
• Lack of documentation
![Page 6: Automation With Frank](https://reader036.vdocument.in/reader036/viewer/2022062616/5492973fb47959424d8b4647/html5/thumbnails/6.jpg)
Frank Architecture
![Page 7: Automation With Frank](https://reader036.vdocument.in/reader036/viewer/2022062616/5492973fb47959424d8b4647/html5/thumbnails/7.jpg)
Communication
• Frankly - simple HTTP-based wire protocol.
• GET and POST requests
• Request and response bodies contain JSON
![Page 8: Automation With Frank](https://reader036.vdocument.in/reader036/viewer/2022062616/5492973fb47959424d8b4647/html5/thumbnails/8.jpg)
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
![Page 9: Automation With Frank](https://reader036.vdocument.in/reader036/viewer/2022062616/5492973fb47959424d8b4647/html5/thumbnails/9.jpg)
Frank Server
• Written in objective-C
• Compiled into the automated iOS application
• Provides responses to the Driver
![Page 10: Automation With Frank](https://reader036.vdocument.in/reader036/viewer/2022062616/5492973fb47959424d8b4647/html5/thumbnails/10.jpg)
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
![Page 11: Automation With Frank](https://reader036.vdocument.in/reader036/viewer/2022062616/5492973fb47959424d8b4647/html5/thumbnails/11.jpg)
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”.
![Page 12: Automation With Frank](https://reader036.vdocument.in/reader036/viewer/2022062616/5492973fb47959424d8b4647/html5/thumbnails/12.jpg)
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
![Page 13: Automation With Frank](https://reader036.vdocument.in/reader036/viewer/2022062616/5492973fb47959424d8b4647/html5/thumbnails/13.jpg)
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
![Page 14: Automation With Frank](https://reader036.vdocument.in/reader036/viewer/2022062616/5492973fb47959424d8b4647/html5/thumbnails/14.jpg)
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
![Page 15: Automation With Frank](https://reader036.vdocument.in/reader036/viewer/2022062616/5492973fb47959424d8b4647/html5/thumbnails/15.jpg)
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/
![Page 16: Automation With Frank](https://reader036.vdocument.in/reader036/viewer/2022062616/5492973fb47959424d8b4647/html5/thumbnails/16.jpg)
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
![Page 17: Automation With Frank](https://reader036.vdocument.in/reader036/viewer/2022062616/5492973fb47959424d8b4647/html5/thumbnails/17.jpg)
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.
![Page 18: Automation With Frank](https://reader036.vdocument.in/reader036/viewer/2022062616/5492973fb47959424d8b4647/html5/thumbnails/18.jpg)
Speaking the same language
• Cucumber supports over 40 spoken languages
• Listing the available languages: cucumber --i18n help
Ahoy! me buckos
![Page 19: Automation With Frank](https://reader036.vdocument.in/reader036/viewer/2022062616/5492973fb47959424d8b4647/html5/thumbnails/19.jpg)
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
![Page 20: Automation With Frank](https://reader036.vdocument.in/reader036/viewer/2022062616/5492973fb47959424d8b4647/html5/thumbnails/20.jpg)
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
![Page 21: Automation With Frank](https://reader036.vdocument.in/reader036/viewer/2022062616/5492973fb47959424d8b4647/html5/thumbnails/21.jpg)
Bibliography
• The Official Website: testingwithfrank.com
• The GitHub Repository: moredip/Frank
• Pete Hodgson’s Blog: Being Agile
• Google Group: Frank
• Frank Helpers: rdoc.info/gems/frank-cucumber