SlideShare a Scribd company logo
1 of 31
Tips & Tricks with
Calabash for
Mobile App Testing
13 March 2014
Ville-Veikko Helppi
Technical Product Manager
ville-veikko.helppi@bitbar.com
Agenda
• Prerequisites for Mobile App Testing
• Calabash Introduction and How It Compares to
Other Test Automation Frameworks
• Inside the Calabash – Building Those Scripts
• Tips & Tricks with Calabash
• Demonstration
• Q&A
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
2
Agenda
• Prerequisites for Mobile App Testing
• Calabash Introduction and How It Compares to
Other Test Automation Frameworks
• Inside the Calabash – Building Those Scripts
• Tips and Tricks with Calabash
• Demonstration
• Q&A
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
3
Why Apps Fail?
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
4
Prerequisites for Mobile App Testing
• Testing environment as authentic as possible
– Real devices <-> emulators/simulators
• Test coverage needs to be adequate
– Software is not identical in all Android/iOS devices
– Hardware is even more fragmented landscape
• Surrounding testing conditions (e.g. network)
• Try not to build in repetitive, manual processes
• Test automation framework that works for you
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
5
What Framework Works You The Best?
• High-level & declarative test automation
frameworks work well when app is under dev
• Easy to integrate with continuous integration
• Distance between use case and actual test
• What do you build: Native, Hybrid or Web app?
• The technical competence in your organization
• Desired outcome from test automation
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
6
What Improves the App Quality?
• Automate generic things as much as you can
• During the development your app changes –
the same must apply for testing!
• Carefully select (testing) technology & partner
• Use all 24 hours per day with test automation
• Cloud-based platform is the only solution to
get you quickly covered in the global markets
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
7
Why Real Devices are Must-to-Have?
• Emulators/simulators won’t help you to test…
– User Experience and Usability
– Hardware
– Software
– Infrastructure
0 % = the percentage of your app users
that use emulator to run your app!
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
8
Basics: Different Ways of Doing Test Automation
Automatic test exercisersRecord and PlaybackHand written test scripts
Benefits:
Accurate, specific to your testing
needs, plenty of options with
frameworks, tools
Fast to create, accurate, not as
sensitive to human-errors as
hand-written tests, tools avail’ty
Fastest & extremely automated,
excellent for smoke testing/quick
testing, availability
Tradeoffs:
Takes a lot of time, ties resources
to write test cases/scripts, error-
prone (humans)
Compelling Recorder+Playback
tools available for only few test
automation frameworks
Not accurate as real test cases
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
9
Agenda
• Prerequisites for Mobile App Testing
• Calabash Introduction and How It Compares
to Other Test Automation Frameworks
• Inside the Calabash – Building Those Scripts
• Tips and Tricks with Calabash
• Demonstration
• Q&A
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
10
Introduction to Calabash
• Behavior driven test framework for native Android &
iOS, and for hybrid web apps (embedded webviews)
• Tests are described in Cucumber and then converted to
Robotium or “similar-to-Frank“ in run time
• Supports currently about 80 different natural language
commands (controllers). New controllers can be
implemented in Ruby or Java
• If your app uses custom UI Widgets you have to create
controllers for those in order to test your app
• Calabash tools include a command line inspector for
finding right UI element names/ids
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
11
Android Example: The Family Tree
of Test Automation Frameworks
JUnit
Android Instrumentation Framework
Robotium Espresso
UI Automator
Calabash
Appium
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
12
Why Calabash is A Good Choice?
• Cross-platform test automation framework
• Human-readable syntax/tests
• Not much changes needed for tests when the
mobile app changes (e.g. UI components)
• Pretty easy to integrate with any CI
• Great choice for teams that have limited
resources for development and/or testing
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
13
Calabash-iOS: Architecture
• Calabash installs an HTTP server as an
instrumentation package that listens
commands from Calabash server
• Tests are executed on server side
• Each test scenario is described in
Cucumber
• Ruby Client library converts Cucumber
commands to ”Frank” method calls
• Webview support is implemented with
Javascript injection to the Webview
iOS device
Your app
Calabash HTTP
server
Test server
Step definitions,
Ruby client
library
Features
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
14
Calabash-Android: Architecture
• Calabash uses Android instrumentation
test server (a separate app)
• Based on
ActivityInstrumentationTestCase2
• Tests are executed on server side
• Predefined and custom steps
• Ruby Client library converts Cucumber
commands to Robotium method calls
• Webview support is implemented with
Javascript injection to the Webview
Android device
Your app
Instrumentation
Test Server
Test server
Step definitions,
Ruby client
library
Features
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
15
Calabash: Code Example
Feature: Login feature
Scenario: As a valid user I can log into my app
I wait for text "Hello"
Then I press view with id "Sign in"
Then I enter text "username" into "login_username"
Then I enter text "password" into "login_password"
Then I wait for activity "HomeTabActivity"
Then I press view with id "menu_compose_tweet"
Then I enter text "Testdroid" into field with id "edit"
Then I press view with id "composer_post"
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
16
How Calabash Compares to Others?
Calabash Robotium uiautomator Espresso Appium
Android Yes Yes Yes Yes Yes
iOS Yes No No No Yes
Mobile web Hybrid
(webviews)
Yes
(Android)
Limited to x.y
clicks
No Yes
(Android & iOS)
Scripting
Language
Ruby Java Java Java Almost any
Test creation
tools
CLI Testdroid
Recorder
UI Automator
viewer
Hierarchy
Viewer
Appium.app
Supported
API levels
All All 16 => 8, 10, 15-19 All
Community Active Contributors Google Google Active
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
17
Example #1: Calabash with Cloud
Developers
Source code
Repository
Build
failed
Successful
build
QA & Testers
Error reporting
Test Cases
Application
Users / Consumers
Commit
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
18
Example #2: Calabash with CI
Developers
Source code
Repository
Build
failed
Successful
build
QA & Testers
Error reporting
Test Cases
Application
Users / Consumers
Commit
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
19
Agenda
• Prerequisites for Mobile App Testing
• Calabash Introduction and How It Compares to
Other Test Automation Frameworks
• Inside the Calabash – Building Those Scripts
• Tips and Tricks with Calabash
• Demonstration
• Q&A
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
20
Step Definitions
• Fast and easy to modify definitions and features
• Predefined and Custom steps
– Predefined steps offer the way to start instantly
– Custom steps provide more options & can be easily
tailored for your app
• Works for both, Android and iOS, when added:
– calabash.framework
– ActivityInstrumentationTestCase2
• Custom steps extremely easy to modify & create
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
21
Test Script – called Features
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
22
Feature: Login feature
Scenario: As a valid user I can log into my app
I wait for text "Hello"
Then I press view with id "Sign in"
Then I enter text "username" into "login_username"
Then I enter text "password" into "login_password"
Then I wait for activity "HomeTabActivity"
Then I press view with id "menu_compose_tweet"
Then I enter text "Testdroid" into field with id "edit"
Then I press view with id "composer_post"
Example: Predefined Steps
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
23
Given /^I press the "([^"]*)" button$/ do |buttonText|
performAction('press_button_with_text', buttonText)
end
Then /^I press button number (d+)$/ do |buttonNumber|
performAction('press_button_number', buttonNumber)
end
Then /^I press image button number (d+)$/ do |buttonNumber|
performAction('press_image_button_number', buttonNumber)
end
Then /^I press view with id "([^"]*)"$/ do |view_id|
performAction('click_on_view_by_id',view_id)
end
From Definition to Feature
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
24
Then /^I press view with id "([^"]*)"$/ do |view_id|
performAction('click_on_view_by_id',view_id)
end
Then I press view with id "menu_compose_tweet"
Definition:
Feature:
Agenda
• Prerequisites for Mobile App Testing
• Calabash Introduction and How It Compares to
Other Test Automation Frameworks
• Building the Calabash Scripts
• Tips and Tricks with Calabash
• Demonstration
• Q&A
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
25
#1: Use Only Real Devices
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
26
#2: Calabash is Perfect for
“Test Early, Test Often” Approach
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
27
#3: Integrate Dev & Testing -> CI
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
28
Commit
Developers
Source code
Repository
Build
failed
Successful
build
QA & Testers
Error reporting
Test Cases
Application
Users / Consumers
Agenda
• Prerequisites for Mobile App Testing
• Calabash Introduction and How It Compares to
Other Test Automation Frameworks
• Inside the Calabash – Building Those Scripts
• Tips and Tricks with Calabash
• Demonstration
• Q&A
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
29
Agenda
• Prerequisites for Mobile App Testing
• Calabash Introduction and How It Compares to
Other Test Automation Frameworks
• Inside the Calabash – Building Those Scripts
• Tips and Tricks with Calabash
• Demonstration
• Q&A
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
30
© Copyrights by Bitbar Technologies Ltd. 2014
All rights reserved.
31

More Related Content

Viewers also liked

Pruebas funcionales de Software
Pruebas funcionales de SoftwarePruebas funcionales de Software
Pruebas funcionales de SoftwareBrian Pando
 
Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013Brian Sam-Bodden
 
Three Uses Of JIRA Beyond Bug Tracking
Three Uses Of JIRA Beyond Bug TrackingThree Uses Of JIRA Beyond Bug Tracking
Three Uses Of JIRA Beyond Bug TrackingAtlassian
 
TestLink introduction
TestLink introductionTestLink introduction
TestLink introductionDavid Ionut
 
Introduction To Confluence
Introduction To ConfluenceIntroduction To Confluence
Introduction To ConfluenceHua Soon Sim
 
Jira as a Tool for Test Management
Jira as a Tool for Test ManagementJira as a Tool for Test Management
Jira as a Tool for Test ManagementMaija Laksa
 
Using JIRA Software for Issue Tracking
Using JIRA Software for Issue TrackingUsing JIRA Software for Issue Tracking
Using JIRA Software for Issue TrackingAnjali Rao
 
Introduction To Jira
Introduction To JiraIntroduction To Jira
Introduction To JiraHua Soon Sim
 
Calabash, an open-source automated testing technology for native mobile, by K...
Calabash, an open-source automated testing technology for native mobile, by K...Calabash, an open-source automated testing technology for native mobile, by K...
Calabash, an open-source automated testing technology for native mobile, by K...Codemotion
 
Story Testing Approach for Enterprise Applications using Selenium Framework
Story Testing Approach for Enterprise Applications using Selenium FrameworkStory Testing Approach for Enterprise Applications using Selenium Framework
Story Testing Approach for Enterprise Applications using Selenium FrameworkOleksiy Rezchykov
 
Gerrit is Getting Native with RPM, Deb and Docker
Gerrit is Getting Native with RPM, Deb and DockerGerrit is Getting Native with RPM, Deb and Docker
Gerrit is Getting Native with RPM, Deb and DockerLuca Milanesio
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumberNibu Baby
 
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)Alvaro Sanchez-Mariscal
 
Continuous integration using Jenkins and Sonar
Continuous integration using Jenkins and SonarContinuous integration using Jenkins and Sonar
Continuous integration using Jenkins and SonarPascal Larocque
 
Sonar qube to impove code quality
Sonar qube   to impove code qualitySonar qube   to impove code quality
Sonar qube to impove code qualityMani Sarkar
 
Design First API's with RAML and SoapUI
Design First API's with RAML and SoapUIDesign First API's with RAML and SoapUI
Design First API's with RAML and SoapUIDaniel Feist
 
Gerrit Code Review with GitHub plugin
Gerrit Code Review with GitHub pluginGerrit Code Review with GitHub plugin
Gerrit Code Review with GitHub pluginLuca Milanesio
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)Dave Haeffner
 

Viewers also liked (20)

Pruebas funcionales de Software
Pruebas funcionales de SoftwarePruebas funcionales de Software
Pruebas funcionales de Software
 
Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013
 
Three Uses Of JIRA Beyond Bug Tracking
Three Uses Of JIRA Beyond Bug TrackingThree Uses Of JIRA Beyond Bug Tracking
Three Uses Of JIRA Beyond Bug Tracking
 
TestLink introduction
TestLink introductionTestLink introduction
TestLink introduction
 
Introduction To Confluence
Introduction To ConfluenceIntroduction To Confluence
Introduction To Confluence
 
Jira as a Tool for Test Management
Jira as a Tool for Test ManagementJira as a Tool for Test Management
Jira as a Tool for Test Management
 
Using JIRA Software for Issue Tracking
Using JIRA Software for Issue TrackingUsing JIRA Software for Issue Tracking
Using JIRA Software for Issue Tracking
 
Introduction To Jira
Introduction To JiraIntroduction To Jira
Introduction To Jira
 
Calabash, an open-source automated testing technology for native mobile, by K...
Calabash, an open-source automated testing technology for native mobile, by K...Calabash, an open-source automated testing technology for native mobile, by K...
Calabash, an open-source automated testing technology for native mobile, by K...
 
Story Testing Approach for Enterprise Applications using Selenium Framework
Story Testing Approach for Enterprise Applications using Selenium FrameworkStory Testing Approach for Enterprise Applications using Selenium Framework
Story Testing Approach for Enterprise Applications using Selenium Framework
 
Next level of Appium
Next level of AppiumNext level of Appium
Next level of Appium
 
Automate you Appium test like a pro!
Automate you Appium test like a pro!Automate you Appium test like a pro!
Automate you Appium test like a pro!
 
Gerrit is Getting Native with RPM, Deb and Docker
Gerrit is Getting Native with RPM, Deb and DockerGerrit is Getting Native with RPM, Deb and Docker
Gerrit is Getting Native with RPM, Deb and Docker
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumber
 
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
 
Continuous integration using Jenkins and Sonar
Continuous integration using Jenkins and SonarContinuous integration using Jenkins and Sonar
Continuous integration using Jenkins and Sonar
 
Sonar qube to impove code quality
Sonar qube   to impove code qualitySonar qube   to impove code quality
Sonar qube to impove code quality
 
Design First API's with RAML and SoapUI
Design First API's with RAML and SoapUIDesign First API's with RAML and SoapUI
Design First API's with RAML and SoapUI
 
Gerrit Code Review with GitHub plugin
Gerrit Code Review with GitHub pluginGerrit Code Review with GitHub plugin
Gerrit Code Review with GitHub plugin
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
 

More from Bitbar

The Best of Both Worlds - Combining Performance and Functional Mobile App Tes...
The Best of Both Worlds - Combining Performance and Functional Mobile App Tes...The Best of Both Worlds - Combining Performance and Functional Mobile App Tes...
The Best of Both Worlds - Combining Performance and Functional Mobile App Tes...Bitbar
 
Mobile performance metrics and performance monitoring meetup 2017 05 10
Mobile performance metrics and performance monitoring meetup 2017 05 10Mobile performance metrics and performance monitoring meetup 2017 05 10
Mobile performance metrics and performance monitoring meetup 2017 05 10Bitbar
 
Exercising and Scaling Up Mobile DevOps in the Enterprise
Exercising and Scaling Up Mobile DevOps in the EnterpriseExercising and Scaling Up Mobile DevOps in the Enterprise
Exercising and Scaling Up Mobile DevOps in the EnterpriseBitbar
 
Getting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingGetting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingBitbar
 
Hassle-Free Continuous Integration with Real Device Testing
Hassle-Free Continuous Integration with Real Device TestingHassle-Free Continuous Integration with Real Device Testing
Hassle-Free Continuous Integration with Real Device TestingBitbar
 
Best Practices for DevOps in Mobile App Testing
Best Practices for DevOps in Mobile App TestingBest Practices for DevOps in Mobile App Testing
Best Practices for DevOps in Mobile App TestingBitbar
 
Ensure Your Mobile Channels Generate Revenue on Holiday Peak Days
Ensure Your Mobile Channels Generate Revenue on Holiday Peak DaysEnsure Your Mobile Channels Generate Revenue on Holiday Peak Days
Ensure Your Mobile Channels Generate Revenue on Holiday Peak DaysBitbar
 
How to Reliably Measure and Optimize Graphics Performance of Your Android Games
How to Reliably Measure and Optimize Graphics Performance of Your Android GamesHow to Reliably Measure and Optimize Graphics Performance of Your Android Games
How to Reliably Measure and Optimize Graphics Performance of Your Android GamesBitbar
 
Parallel Test Runs with Appium on Real Mobile Devices – Hands-on Webinar
Parallel Test Runs with Appium on Real Mobile Devices – Hands-on WebinarParallel Test Runs with Appium on Real Mobile Devices – Hands-on Webinar
Parallel Test Runs with Appium on Real Mobile Devices – Hands-on WebinarBitbar
 
LDNSE: Testdroid for Mobile App and Web Testing (London Selenium Meetup)
LDNSE: Testdroid for Mobile App and Web Testing (London Selenium Meetup)LDNSE: Testdroid for Mobile App and Web Testing (London Selenium Meetup)
LDNSE: Testdroid for Mobile App and Web Testing (London Selenium Meetup)Bitbar
 
The Powerful and Comprehensive API for Mobile App Development and Testing
The Powerful and Comprehensive API for Mobile App Development and TestingThe Powerful and Comprehensive API for Mobile App Development and Testing
The Powerful and Comprehensive API for Mobile App Development and TestingBitbar
 
Which One Works You The Best: In-House or Cloud-Based Development Environment
Which One Works You The Best: In-House or Cloud-Based Development EnvironmentWhich One Works You The Best: In-House or Cloud-Based Development Environment
Which One Works You The Best: In-House or Cloud-Based Development EnvironmentBitbar
 
Best Practices in Mobile Game Testing
Best Practices in Mobile Game TestingBest Practices in Mobile Game Testing
Best Practices in Mobile Game TestingBitbar
 
Build a Large Scale In-House Test Lab for Mobile Apps
Build a Large Scale In-House Test Lab for Mobile AppsBuild a Large Scale In-House Test Lab for Mobile Apps
Build a Large Scale In-House Test Lab for Mobile AppsBitbar
 
The Status of Android Hardware and Software - From App Developer's Point of View
The Status of Android Hardware and Software - From App Developer's Point of ViewThe Status of Android Hardware and Software - From App Developer's Point of View
The Status of Android Hardware and Software - From App Developer's Point of ViewBitbar
 
Do You Enjoy Espresso in Android App Testing?
Do You Enjoy Espresso in Android App Testing?Do You Enjoy Espresso in Android App Testing?
Do You Enjoy Espresso in Android App Testing?Bitbar
 
Testing Your Android and iOS Apps with Appium in Testdroid Cloud
Testing Your Android and iOS Apps with Appium in Testdroid CloudTesting Your Android and iOS Apps with Appium in Testdroid Cloud
Testing Your Android and iOS Apps with Appium in Testdroid CloudBitbar
 
How to Leverage Appium in Your Mobile App Testing
How to Leverage Appium in Your Mobile App TestingHow to Leverage Appium in Your Mobile App Testing
How to Leverage Appium in Your Mobile App TestingBitbar
 
How to Test Security and Vulnerability of Your Android and iOS Apps
How to Test Security and Vulnerability of Your Android and iOS AppsHow to Test Security and Vulnerability of Your Android and iOS Apps
How to Test Security and Vulnerability of Your Android and iOS AppsBitbar
 
Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?Bitbar
 

More from Bitbar (20)

The Best of Both Worlds - Combining Performance and Functional Mobile App Tes...
The Best of Both Worlds - Combining Performance and Functional Mobile App Tes...The Best of Both Worlds - Combining Performance and Functional Mobile App Tes...
The Best of Both Worlds - Combining Performance and Functional Mobile App Tes...
 
Mobile performance metrics and performance monitoring meetup 2017 05 10
Mobile performance metrics and performance monitoring meetup 2017 05 10Mobile performance metrics and performance monitoring meetup 2017 05 10
Mobile performance metrics and performance monitoring meetup 2017 05 10
 
Exercising and Scaling Up Mobile DevOps in the Enterprise
Exercising and Scaling Up Mobile DevOps in the EnterpriseExercising and Scaling Up Mobile DevOps in the Enterprise
Exercising and Scaling Up Mobile DevOps in the Enterprise
 
Getting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingGetting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App Testing
 
Hassle-Free Continuous Integration with Real Device Testing
Hassle-Free Continuous Integration with Real Device TestingHassle-Free Continuous Integration with Real Device Testing
Hassle-Free Continuous Integration with Real Device Testing
 
Best Practices for DevOps in Mobile App Testing
Best Practices for DevOps in Mobile App TestingBest Practices for DevOps in Mobile App Testing
Best Practices for DevOps in Mobile App Testing
 
Ensure Your Mobile Channels Generate Revenue on Holiday Peak Days
Ensure Your Mobile Channels Generate Revenue on Holiday Peak DaysEnsure Your Mobile Channels Generate Revenue on Holiday Peak Days
Ensure Your Mobile Channels Generate Revenue on Holiday Peak Days
 
How to Reliably Measure and Optimize Graphics Performance of Your Android Games
How to Reliably Measure and Optimize Graphics Performance of Your Android GamesHow to Reliably Measure and Optimize Graphics Performance of Your Android Games
How to Reliably Measure and Optimize Graphics Performance of Your Android Games
 
Parallel Test Runs with Appium on Real Mobile Devices – Hands-on Webinar
Parallel Test Runs with Appium on Real Mobile Devices – Hands-on WebinarParallel Test Runs with Appium on Real Mobile Devices – Hands-on Webinar
Parallel Test Runs with Appium on Real Mobile Devices – Hands-on Webinar
 
LDNSE: Testdroid for Mobile App and Web Testing (London Selenium Meetup)
LDNSE: Testdroid for Mobile App and Web Testing (London Selenium Meetup)LDNSE: Testdroid for Mobile App and Web Testing (London Selenium Meetup)
LDNSE: Testdroid for Mobile App and Web Testing (London Selenium Meetup)
 
The Powerful and Comprehensive API for Mobile App Development and Testing
The Powerful and Comprehensive API for Mobile App Development and TestingThe Powerful and Comprehensive API for Mobile App Development and Testing
The Powerful and Comprehensive API for Mobile App Development and Testing
 
Which One Works You The Best: In-House or Cloud-Based Development Environment
Which One Works You The Best: In-House or Cloud-Based Development EnvironmentWhich One Works You The Best: In-House or Cloud-Based Development Environment
Which One Works You The Best: In-House or Cloud-Based Development Environment
 
Best Practices in Mobile Game Testing
Best Practices in Mobile Game TestingBest Practices in Mobile Game Testing
Best Practices in Mobile Game Testing
 
Build a Large Scale In-House Test Lab for Mobile Apps
Build a Large Scale In-House Test Lab for Mobile AppsBuild a Large Scale In-House Test Lab for Mobile Apps
Build a Large Scale In-House Test Lab for Mobile Apps
 
The Status of Android Hardware and Software - From App Developer's Point of View
The Status of Android Hardware and Software - From App Developer's Point of ViewThe Status of Android Hardware and Software - From App Developer's Point of View
The Status of Android Hardware and Software - From App Developer's Point of View
 
Do You Enjoy Espresso in Android App Testing?
Do You Enjoy Espresso in Android App Testing?Do You Enjoy Espresso in Android App Testing?
Do You Enjoy Espresso in Android App Testing?
 
Testing Your Android and iOS Apps with Appium in Testdroid Cloud
Testing Your Android and iOS Apps with Appium in Testdroid CloudTesting Your Android and iOS Apps with Appium in Testdroid Cloud
Testing Your Android and iOS Apps with Appium in Testdroid Cloud
 
How to Leverage Appium in Your Mobile App Testing
How to Leverage Appium in Your Mobile App TestingHow to Leverage Appium in Your Mobile App Testing
How to Leverage Appium in Your Mobile App Testing
 
How to Test Security and Vulnerability of Your Android and iOS Apps
How to Test Security and Vulnerability of Your Android and iOS AppsHow to Test Security and Vulnerability of Your Android and iOS Apps
How to Test Security and Vulnerability of Your Android and iOS Apps
 
Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?
 

Recently uploaded

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

Tips and Tricks with Calabash for Mobile App Testing

  • 1. Tips & Tricks with Calabash for Mobile App Testing 13 March 2014 Ville-Veikko Helppi Technical Product Manager ville-veikko.helppi@bitbar.com
  • 2. Agenda • Prerequisites for Mobile App Testing • Calabash Introduction and How It Compares to Other Test Automation Frameworks • Inside the Calabash – Building Those Scripts • Tips & Tricks with Calabash • Demonstration • Q&A © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 2
  • 3. Agenda • Prerequisites for Mobile App Testing • Calabash Introduction and How It Compares to Other Test Automation Frameworks • Inside the Calabash – Building Those Scripts • Tips and Tricks with Calabash • Demonstration • Q&A © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 3
  • 4. Why Apps Fail? © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 4
  • 5. Prerequisites for Mobile App Testing • Testing environment as authentic as possible – Real devices <-> emulators/simulators • Test coverage needs to be adequate – Software is not identical in all Android/iOS devices – Hardware is even more fragmented landscape • Surrounding testing conditions (e.g. network) • Try not to build in repetitive, manual processes • Test automation framework that works for you © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 5
  • 6. What Framework Works You The Best? • High-level & declarative test automation frameworks work well when app is under dev • Easy to integrate with continuous integration • Distance between use case and actual test • What do you build: Native, Hybrid or Web app? • The technical competence in your organization • Desired outcome from test automation © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 6
  • 7. What Improves the App Quality? • Automate generic things as much as you can • During the development your app changes – the same must apply for testing! • Carefully select (testing) technology & partner • Use all 24 hours per day with test automation • Cloud-based platform is the only solution to get you quickly covered in the global markets © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 7
  • 8. Why Real Devices are Must-to-Have? • Emulators/simulators won’t help you to test… – User Experience and Usability – Hardware – Software – Infrastructure 0 % = the percentage of your app users that use emulator to run your app! © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 8
  • 9. Basics: Different Ways of Doing Test Automation Automatic test exercisersRecord and PlaybackHand written test scripts Benefits: Accurate, specific to your testing needs, plenty of options with frameworks, tools Fast to create, accurate, not as sensitive to human-errors as hand-written tests, tools avail’ty Fastest & extremely automated, excellent for smoke testing/quick testing, availability Tradeoffs: Takes a lot of time, ties resources to write test cases/scripts, error- prone (humans) Compelling Recorder+Playback tools available for only few test automation frameworks Not accurate as real test cases © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 9
  • 10. Agenda • Prerequisites for Mobile App Testing • Calabash Introduction and How It Compares to Other Test Automation Frameworks • Inside the Calabash – Building Those Scripts • Tips and Tricks with Calabash • Demonstration • Q&A © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 10
  • 11. Introduction to Calabash • Behavior driven test framework for native Android & iOS, and for hybrid web apps (embedded webviews) • Tests are described in Cucumber and then converted to Robotium or “similar-to-Frank“ in run time • Supports currently about 80 different natural language commands (controllers). New controllers can be implemented in Ruby or Java • If your app uses custom UI Widgets you have to create controllers for those in order to test your app • Calabash tools include a command line inspector for finding right UI element names/ids © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 11
  • 12. Android Example: The Family Tree of Test Automation Frameworks JUnit Android Instrumentation Framework Robotium Espresso UI Automator Calabash Appium © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 12
  • 13. Why Calabash is A Good Choice? • Cross-platform test automation framework • Human-readable syntax/tests • Not much changes needed for tests when the mobile app changes (e.g. UI components) • Pretty easy to integrate with any CI • Great choice for teams that have limited resources for development and/or testing © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 13
  • 14. Calabash-iOS: Architecture • Calabash installs an HTTP server as an instrumentation package that listens commands from Calabash server • Tests are executed on server side • Each test scenario is described in Cucumber • Ruby Client library converts Cucumber commands to ”Frank” method calls • Webview support is implemented with Javascript injection to the Webview iOS device Your app Calabash HTTP server Test server Step definitions, Ruby client library Features © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 14
  • 15. Calabash-Android: Architecture • Calabash uses Android instrumentation test server (a separate app) • Based on ActivityInstrumentationTestCase2 • Tests are executed on server side • Predefined and custom steps • Ruby Client library converts Cucumber commands to Robotium method calls • Webview support is implemented with Javascript injection to the Webview Android device Your app Instrumentation Test Server Test server Step definitions, Ruby client library Features © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 15
  • 16. Calabash: Code Example Feature: Login feature Scenario: As a valid user I can log into my app I wait for text "Hello" Then I press view with id "Sign in" Then I enter text "username" into "login_username" Then I enter text "password" into "login_password" Then I wait for activity "HomeTabActivity" Then I press view with id "menu_compose_tweet" Then I enter text "Testdroid" into field with id "edit" Then I press view with id "composer_post" © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 16
  • 17. How Calabash Compares to Others? Calabash Robotium uiautomator Espresso Appium Android Yes Yes Yes Yes Yes iOS Yes No No No Yes Mobile web Hybrid (webviews) Yes (Android) Limited to x.y clicks No Yes (Android & iOS) Scripting Language Ruby Java Java Java Almost any Test creation tools CLI Testdroid Recorder UI Automator viewer Hierarchy Viewer Appium.app Supported API levels All All 16 => 8, 10, 15-19 All Community Active Contributors Google Google Active © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 17
  • 18. Example #1: Calabash with Cloud Developers Source code Repository Build failed Successful build QA & Testers Error reporting Test Cases Application Users / Consumers Commit © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 18
  • 19. Example #2: Calabash with CI Developers Source code Repository Build failed Successful build QA & Testers Error reporting Test Cases Application Users / Consumers Commit © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 19
  • 20. Agenda • Prerequisites for Mobile App Testing • Calabash Introduction and How It Compares to Other Test Automation Frameworks • Inside the Calabash – Building Those Scripts • Tips and Tricks with Calabash • Demonstration • Q&A © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 20
  • 21. Step Definitions • Fast and easy to modify definitions and features • Predefined and Custom steps – Predefined steps offer the way to start instantly – Custom steps provide more options & can be easily tailored for your app • Works for both, Android and iOS, when added: – calabash.framework – ActivityInstrumentationTestCase2 • Custom steps extremely easy to modify & create © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 21
  • 22. Test Script – called Features © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 22 Feature: Login feature Scenario: As a valid user I can log into my app I wait for text "Hello" Then I press view with id "Sign in" Then I enter text "username" into "login_username" Then I enter text "password" into "login_password" Then I wait for activity "HomeTabActivity" Then I press view with id "menu_compose_tweet" Then I enter text "Testdroid" into field with id "edit" Then I press view with id "composer_post"
  • 23. Example: Predefined Steps © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 23 Given /^I press the "([^"]*)" button$/ do |buttonText| performAction('press_button_with_text', buttonText) end Then /^I press button number (d+)$/ do |buttonNumber| performAction('press_button_number', buttonNumber) end Then /^I press image button number (d+)$/ do |buttonNumber| performAction('press_image_button_number', buttonNumber) end Then /^I press view with id "([^"]*)"$/ do |view_id| performAction('click_on_view_by_id',view_id) end
  • 24. From Definition to Feature © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 24 Then /^I press view with id "([^"]*)"$/ do |view_id| performAction('click_on_view_by_id',view_id) end Then I press view with id "menu_compose_tweet" Definition: Feature:
  • 25. Agenda • Prerequisites for Mobile App Testing • Calabash Introduction and How It Compares to Other Test Automation Frameworks • Building the Calabash Scripts • Tips and Tricks with Calabash • Demonstration • Q&A © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 25
  • 26. #1: Use Only Real Devices © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 26
  • 27. #2: Calabash is Perfect for “Test Early, Test Often” Approach © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 27
  • 28. #3: Integrate Dev & Testing -> CI © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 28 Commit Developers Source code Repository Build failed Successful build QA & Testers Error reporting Test Cases Application Users / Consumers
  • 29. Agenda • Prerequisites for Mobile App Testing • Calabash Introduction and How It Compares to Other Test Automation Frameworks • Inside the Calabash – Building Those Scripts • Tips and Tricks with Calabash • Demonstration • Q&A © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 29
  • 30. Agenda • Prerequisites for Mobile App Testing • Calabash Introduction and How It Compares to Other Test Automation Frameworks • Inside the Calabash – Building Those Scripts • Tips and Tricks with Calabash • Demonstration • Q&A © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 30
  • 31. © Copyrights by Bitbar Technologies Ltd. 2014 All rights reserved. 31