SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
Test Automation
Using Cucumber and Calabash
Xavier Yin 201/01/15
Outline
 Introduction
– Testing
– Comparisons
– Automation Testing Tool
– Implement Steps
 Environments
– Ruby Installer
– Devkit
– Rails and Calabash-Android
 Implements
Testing
 Unit Testing
– A software testing method by which individual units of source code
 Integration Testing
– A phase in software testing in which individual software modules are
combined and tested as a group.
 Regression Testing
– A type of software testing that seeks to uncover new software bugs, or
regressions
Manual and Automatic
Manual Automatic
High Effort and Cost requirements Low Effort and Cost requirements
Time consuming
Quick, allows test engineers to focus on
functional areas
Tests are not reusable
Complete reusability based on type of
implementation
Mostly used for integration tests
Can be used for any tests including load,
sanity, system, etc
Risk of human errors Script validates all areas once tested
Automation Testing Tool
Cucumber
 A framework for writing software specifications
 A tool for executing those specifications
– Specifications are written in a readable language that is close to
natural language.
– Scenarios – user behavior driven tests
– Steps – combine mobile operation and logic
Calabash
 A tool
– Predefined and custom steps
– Reuse of tests across platform possible
– For BDD-style acceptance testing
 Run on physical devices or simulators
 Support for webview
 Ruby based
 Cross-platform mobile testing tool
– Cucumber: Android or IOS testing
Implement Steps
Describe behavior in plain text
Write a step definition in Ruby
Run and watch it fail Run and watch it success
Write code to make the step pass
Describe behavior in plain text
 Feature
– Descriptions
 Scenario
– Descriptions
– Preconditions
– Steps
 Given
 When
 And
 But
 Then
Write a step definition in Ruby
Run and watch it fail
 Fail
– Red light and notifications
Write code to make the step pass
Modify
Observer Results and Reports
 Success
– Green light like a cuke
Ruby Installer
 Download RubyInstaller
 Install
– Check the option named “Add Ruby executables to your PATH”
– Test it
 Using “ruby –v” on cmd window
– Observer
 Show “ruby 2.0.0p353 (2013-11-22) [x64-mingw32]”is success.
DevKit
 Download DevKit in a folder which you want to save
– For Instance: D:DevKit
 Navigate the folder on cmd window
– Using “ruby de.rb init”
 Check the file named config.yml is existent
 Using “ruby dk.rb install”on cmd window
Rails and Calabash-Android
 Using “gem update --system” and “gem install rails --no-ri --no-
rdoc”on cmd window
 Install Rails
– Using “gem install rails --no-ri --no-rdoc”
 Test it
– Using “rails –v” on cmd window
 It is successful to show “Rails 4.0.2”
 Using “gem install calabash-android” on cmd window
Prepare Test Cases
 Create a Cucumber skeleton
in your Android project
– Using “calabash-android gen”
on cmd window
 Create a *.feature file
– That is a test case file including
features, function descriptions or
scenarios.
Given, When and Then
 Given
– your preconditions
 When
– describe the key action
 Then
– observe outcomes or an assertion
 And, But
– Using it if you have several givens, whens or thens.
Basic API
 Find out a view - Query(uiquery, *args)
– You can find views and other application objects, and make assertions
about them or extract data from them, and query returns an array of
its results.
 For instance:
Basic API
 Touch - touch(uiquery, options={})
– Touches a view found by performing the query uiquery.
 For instance:
Basic API
 Entering text - enter_text(uiquery, text, options={})
– Taps the first element returned by uiquery, then enters text into the
view.
 For instance:
Basic API
 Tap - tap_when_element_exists(uiquery, options={})
– Waits for an element and taps it when it appears on screen. It raises an
exception if the element doesn't appear within the timeout.
 For instance:
Basic API
 Scroll - scroll_down and scroll_up
– Scrolls the first instance of 'android.widget.ScrollView' either
downwards or upwards.
 For instance:
Run your APP and generate a report
 Using “calabash-android run apkName.apk –format
html –out reports.html” on cmd window

More Related Content

PDF
Test Automation
PDF
Introduction to Software Test Automation
PDF
Automated vs manual testing
PDF
Test Automation - Keytorc Approach
PPTX
Introduction to Automation Testing
PPT
Automated Testing vs Manual Testing
PPTX
Automation Testing
PPTX
Best practices for test automation
Test Automation
Introduction to Software Test Automation
Automated vs manual testing
Test Automation - Keytorc Approach
Introduction to Automation Testing
Automated Testing vs Manual Testing
Automation Testing
Best practices for test automation

What's hot (20)

PPT
Automation testing
PPT
Automated Testing with Agile
PPTX
Selenium test automation
PPT
Test automation process
PDF
Test Automation
PPT
Test Automation Best Practices (with SOA test approach)
PPT
Automated Testing vs Manual Testing
PPTX
Automation testing
PDF
Test Automation Framework Design | www.idexcel.com
PDF
Test automation methodologies
PDF
Automation testing introduction for FujiNet
PPT
Test Automation Framework Designs
PPTX
Test automation framework
PPTX
Introduction to Automation Testing
PPT
Selenium Automation Framework
PPTX
So you think you can write a test case
PPT
Automation With A Tool Demo
PDF
Building a Test Automation Strategy for Success
PDF
Automation Testing using Selenium
DOCX
Automation Testing Syllabus - Checklist
Automation testing
Automated Testing with Agile
Selenium test automation
Test automation process
Test Automation
Test Automation Best Practices (with SOA test approach)
Automated Testing vs Manual Testing
Automation testing
Test Automation Framework Design | www.idexcel.com
Test automation methodologies
Automation testing introduction for FujiNet
Test Automation Framework Designs
Test automation framework
Introduction to Automation Testing
Selenium Automation Framework
So you think you can write a test case
Automation With A Tool Demo
Building a Test Automation Strategy for Success
Automation Testing using Selenium
Automation Testing Syllabus - Checklist
Ad

Viewers also liked (14)

PPTX
Learning's from mobile testing
PPT
Introduction to Gauge
PDF
Create the Future - Innovations in Testing
PDF
Arjuna - Reinventing the Test Automation Wheels
PPT
Tw specifications for-testing1
PPTX
Specifications test automation pyramid public
PDF
13 Test Automation Practices You Should be Afraid Of
PDF
Need for automation testing
PDF
Say NO To (More) Selenium Tests
PDF
ICT for Automotive Industry
DOCX
Automation Frame works Instruction Sheet
PDF
Introduction to Test Automation
PDF
Test Automation - Principles and Practices
PPTX
How to be an awesome test automation professional
Learning's from mobile testing
Introduction to Gauge
Create the Future - Innovations in Testing
Arjuna - Reinventing the Test Automation Wheels
Tw specifications for-testing1
Specifications test automation pyramid public
13 Test Automation Practices You Should be Afraid Of
Need for automation testing
Say NO To (More) Selenium Tests
ICT for Automotive Industry
Automation Frame works Instruction Sheet
Introduction to Test Automation
Test Automation - Principles and Practices
How to be an awesome test automation professional
Ad

Similar to Test automation (20)

PPT
Calabash automated test
PPTX
Calabash-android
PDF
Behavior driven development with calabash for android
PPTX
Calabash Mobile App Automated Testing Framework
PPTX
Calabash Mobile Application Testing Overview
PPTX
Cucumber - Maria Machlowska
PPTX
I, For One, Welcome Our New Robot Overlords
DOCX
Calabash my understanding
PPT
Android testing calabash
PDF
iOS and Android Acceptance Testing with Calabash - Xcake Dublin
PPT
Review of an open source unit test tool- Cucumber_Presentation
PPTX
Testdroid:
PPTX
Behavior Driven Development - TdT@Cluj #15
DOCX
Cucumber testing
DOCX
Cucumber testing
PPTX
eGo meetup - Сalabash in mobile automated testing
PPTX
Cross Platform Mobile Automation with Calabash on Cloud and More
PPT
Selenium and Cucumber Selenium Conf 2011
PPT
Cucumber Presentation Kiev Meet Up
Calabash automated test
Calabash-android
Behavior driven development with calabash for android
Calabash Mobile App Automated Testing Framework
Calabash Mobile Application Testing Overview
Cucumber - Maria Machlowska
I, For One, Welcome Our New Robot Overlords
Calabash my understanding
Android testing calabash
iOS and Android Acceptance Testing with Calabash - Xcake Dublin
Review of an open source unit test tool- Cucumber_Presentation
Testdroid:
Behavior Driven Development - TdT@Cluj #15
Cucumber testing
Cucumber testing
eGo meetup - Сalabash in mobile automated testing
Cross Platform Mobile Automation with Calabash on Cloud and More
Selenium and Cucumber Selenium Conf 2011
Cucumber Presentation Kiev Meet Up

More from Xavier Yin (12)

PPTX
UI/UX - 別讓我思考
PPTX
機器學習與資料探勘:決策樹
PPTX
Tku-網路資料的串接與資料儲存
PPTX
Tku-行動app開發管理實務-Android應用程式開發基礎
PPTX
Tku-行動app開發管理實務-如何開發Android應用程式
PPTX
TKU行動APP開發管理實務 - ListView & Custom Adapter
PPTX
行動App開發管理實務unit4
PPTX
行動App開發管理實務unit3
PPTX
Material design - widgets and sample code
PPTX
行動App開發管理實務 unit2
PPTX
Material design introduction
PPTX
行動App開發管理實務 unit1
UI/UX - 別讓我思考
機器學習與資料探勘:決策樹
Tku-網路資料的串接與資料儲存
Tku-行動app開發管理實務-Android應用程式開發基礎
Tku-行動app開發管理實務-如何開發Android應用程式
TKU行動APP開發管理實務 - ListView & Custom Adapter
行動App開發管理實務unit4
行動App開發管理實務unit3
Material design - widgets and sample code
行動App開發管理實務 unit2
Material design introduction
行動App開發管理實務 unit1

Recently uploaded (20)

PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Advanced Soft Computing BINUS July 2025.pdf
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Electronic commerce courselecture one. Pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Understanding_Digital_Forensics_Presentation.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Chapter 3 Spatial Domain Image Processing.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
“AI and Expert System Decision Support & Business Intelligence Systems”
Advanced Soft Computing BINUS July 2025.pdf
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
NewMind AI Monthly Chronicles - July 2025
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
NewMind AI Weekly Chronicles - August'25 Week I
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Dropbox Q2 2025 Financial Results & Investor Presentation
Electronic commerce courselecture one. Pdf
Big Data Technologies - Introduction.pptx
Spectral efficient network and resource selection model in 5G networks
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
GamePlan Trading System Review: Professional Trader's Honest Take
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
CIFDAQ's Market Insight: SEC Turns Pro Crypto

Test automation

  • 1. Test Automation Using Cucumber and Calabash Xavier Yin 201/01/15
  • 2. Outline  Introduction – Testing – Comparisons – Automation Testing Tool – Implement Steps  Environments – Ruby Installer – Devkit – Rails and Calabash-Android  Implements
  • 3. Testing  Unit Testing – A software testing method by which individual units of source code  Integration Testing – A phase in software testing in which individual software modules are combined and tested as a group.  Regression Testing – A type of software testing that seeks to uncover new software bugs, or regressions
  • 4. Manual and Automatic Manual Automatic High Effort and Cost requirements Low Effort and Cost requirements Time consuming Quick, allows test engineers to focus on functional areas Tests are not reusable Complete reusability based on type of implementation Mostly used for integration tests Can be used for any tests including load, sanity, system, etc Risk of human errors Script validates all areas once tested
  • 6. Cucumber  A framework for writing software specifications  A tool for executing those specifications – Specifications are written in a readable language that is close to natural language. – Scenarios – user behavior driven tests – Steps – combine mobile operation and logic
  • 7. Calabash  A tool – Predefined and custom steps – Reuse of tests across platform possible – For BDD-style acceptance testing  Run on physical devices or simulators  Support for webview  Ruby based  Cross-platform mobile testing tool – Cucumber: Android or IOS testing
  • 8. Implement Steps Describe behavior in plain text Write a step definition in Ruby Run and watch it fail Run and watch it success Write code to make the step pass
  • 9. Describe behavior in plain text  Feature – Descriptions  Scenario – Descriptions – Preconditions – Steps  Given  When  And  But  Then
  • 10. Write a step definition in Ruby
  • 11. Run and watch it fail  Fail – Red light and notifications
  • 12. Write code to make the step pass Modify
  • 13. Observer Results and Reports  Success – Green light like a cuke
  • 14. Ruby Installer  Download RubyInstaller  Install – Check the option named “Add Ruby executables to your PATH” – Test it  Using “ruby –v” on cmd window – Observer  Show “ruby 2.0.0p353 (2013-11-22) [x64-mingw32]”is success.
  • 15. DevKit  Download DevKit in a folder which you want to save – For Instance: D:DevKit  Navigate the folder on cmd window – Using “ruby de.rb init”  Check the file named config.yml is existent  Using “ruby dk.rb install”on cmd window
  • 16. Rails and Calabash-Android  Using “gem update --system” and “gem install rails --no-ri --no- rdoc”on cmd window  Install Rails – Using “gem install rails --no-ri --no-rdoc”  Test it – Using “rails –v” on cmd window  It is successful to show “Rails 4.0.2”  Using “gem install calabash-android” on cmd window
  • 17. Prepare Test Cases  Create a Cucumber skeleton in your Android project – Using “calabash-android gen” on cmd window  Create a *.feature file – That is a test case file including features, function descriptions or scenarios.
  • 18. Given, When and Then  Given – your preconditions  When – describe the key action  Then – observe outcomes or an assertion  And, But – Using it if you have several givens, whens or thens.
  • 19. Basic API  Find out a view - Query(uiquery, *args) – You can find views and other application objects, and make assertions about them or extract data from them, and query returns an array of its results.  For instance:
  • 20. Basic API  Touch - touch(uiquery, options={}) – Touches a view found by performing the query uiquery.  For instance:
  • 21. Basic API  Entering text - enter_text(uiquery, text, options={}) – Taps the first element returned by uiquery, then enters text into the view.  For instance:
  • 22. Basic API  Tap - tap_when_element_exists(uiquery, options={}) – Waits for an element and taps it when it appears on screen. It raises an exception if the element doesn't appear within the timeout.  For instance:
  • 23. Basic API  Scroll - scroll_down and scroll_up – Scrolls the first instance of 'android.widget.ScrollView' either downwards or upwards.  For instance:
  • 24. Run your APP and generate a report  Using “calabash-android run apkName.apk –format html –out reports.html” on cmd window