SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Downloaden Sie, um offline zu lesen
Behavior-Driven Development (BDD)
And Automation Testing With
Cucumber
TRONG BUI & THONG NGUYEN
STC 2014
Sample Requirement
Feature: login to the system.
As a user,
I want to login into the system when I provide username and
password.
Scenario: login successfully
Given the login page is opening
When I input username into the username textbox
And I input valid password into the password textbox
And I click Login button
Then I am on the Home page
2
Automation Test
@Test
public void fb_login_test() throws Exception {
driver.get("https://www.facebook.com/");
driver.findElement(By.id("email")).clear();
driver.findElement(By.id("email")).sendKeys("bddtest@yahoo.com");
driver.findElement(By.id("pass")).clear();
driver.findElement(By.id("pass")).sendKeys("********");
driver.findElement(By.id("u_0_e")).click();
}
3
Automation Test?
Feature: login to the system.
As a user,
I want to login into the system when I provide username and
password.
Scenario: login successfully
Given the login page is opening
When I input username into the username textbox
And I input valid password into the password textbox
And I click Login button
Then I am on the Home page
4
Behavior-Driven Development
(BDD)
And Automation Testing With
Cucumber
5
AGENDA
 Behavior-driven development
 Automation Testing with Cucumber
 BDD/Cucumber – Pros & Cons
 Q&A
6
7
Behavior-driven development
Behavior-driven
development
8
Given, When, Then
9
10
AUTOMATION TESTING WITH
CUCUMBER
Cucumber Approach
11
Given /^I launch "([^"]*)" page$/ do |page|
visit(page)
End
When /^I fill in "([^"]*)" with "([^"]*)"$/ do |field, value|
fill_in field, :with => value
end
Feature: Login to Email system.
As an employee, I want to login into my email system with
provided username and password.
Scenario: Verify that employee could login email system
Given I launch "https://accounts.google.com" page
When I fill in “Email " with “hcmc-stc-12-jul@gmail.com"
And I fill in “Passwd" with “hcmc-stc-passwd"
And I click on "signIn" button
Then I am on the “Home” page
Scenario Example in BDD
Format
Feature: Login to Email system.
As an employee, I want to login into my email system with provided username and
password.
Scenario: Verify that employee could login email system
@tag_login_email
Scenario Outline: Verify that can login gmail
Given I launch "https://accounts.google.com" page
When I fill in “Email " with “<Email >"
And I fill in “Passwd" with "<Password> "
And I click on "signIn" button
Then I am on the “Home” page
Scenarios:
| Email | Password |
| hcmc-stc-12-jul@gmail.com | hcmc-stc@2013|
| hcmc-stc-user@gmail.com | hcmc-stc@1234|
12
Summary
13
Demo
• Web application:
Cucumber + Capybara
• Web services:
Cucumber + HTTParty + Savon
14
Demo: Web Application
15
Feature: Login to Email system.
As an employee, I want to login into my email system with provided username and
password.
Scenario: Verify that employee could login email system
@tag_login_email
Scenario Outline: Verify that employee could login email system
Given I launch "https://accounts.google.com" page
When I fill in “Email " with “<Email >"
And I fill in “Passwd" with "<Password> "
And I click on "signIn" button
Then I should see text "<Message>“
Scenarios:
| Email | Password | Message |
| demo01.hcmc.stc@gmail.com | demo@2013 | Primary Email demo01… |
| demo02.hcmc.stc@gmail.com | demo1@1234 | Primary Email demo02… |
| Nonexist.hcmc.stc@gmail.com | demo1@1234 | Invalid email or password|
Demo: Web Services
Feature: Get Weather status to display on webpage
As an owner of Traveling Service, I want to be able to get weather status of
any location based on address of client's request
Scenario Outline: Get weather status by address of client's requests
Given The check IP location and weather web services are running
When I send request to get location detail of address "<Address>"
Then I should have ZIP code and "<Country>" of that location
And I send request to get weather status of that location by its ZIP code
Then I should receive current "Temperature, Wind, RelativeHumidity"
and "<City_Name>" and "<State>" of that location
Scenarios:
|Address |Country |City_Name |State |
|www.google.com |United States |Mountain View |California|
16
17
BDD/CUCUMBER – PROS &
CONS
18
BDD/Cucumber - Pros
 BBD is FRIENDLY and UNDERSTANDABLE by non-
technical users
 Great support from RUBY community - Automation
framework based BDD Cucumber is NOT REALLY
HARD to develop and maintenance
 Support on MULTIPLE PLATFORM, OS and different
browsers
19
BDD/Cucumber - Cons
 Incompatibility among GEM versions
 Lacking of tool for managing Features and
Scenarios effectively
20
Q&A
References
21
• All about BDD Cucumber: http://cukes.info/
• BDD cucumber book: http://www.amazon.com/The-Cucumber-
Book-Behaviour-Driven-Development/dp/1934356808
• Ruby gems: http://rubygems.org
• Ruby programming: http://www.ruby-lang.org
© 2014 HCMC Software Testing Club
THANK YOU

Weitere ähnliche Inhalte

Was ist angesagt?

Behavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile TestingBehavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile Testing
dversaci
 
Chanhao Jiang And David Wei Presentation Quickling Pagecache
Chanhao Jiang And David Wei Presentation Quickling PagecacheChanhao Jiang And David Wei Presentation Quickling Pagecache
Chanhao Jiang And David Wei Presentation Quickling Pagecache
Ajax Experience 2009
 
Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWeb
Dave Bouwman
 

Was ist angesagt? (20)

greach 2014 marco vermeulen bdd using cucumber jvm and groovy
greach 2014 marco vermeulen bdd using cucumber jvm and groovygreach 2014 marco vermeulen bdd using cucumber jvm and groovy
greach 2014 marco vermeulen bdd using cucumber jvm and groovy
 
Web automation in BDD
Web automation in BDDWeb automation in BDD
Web automation in BDD
 
Behavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile TestingBehavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile Testing
 
CUCUMBER - Making BDD Fun
CUCUMBER - Making BDD FunCUCUMBER - Making BDD Fun
CUCUMBER - Making BDD Fun
 
Test automation with Cucumber-JVM
Test automation with Cucumber-JVMTest automation with Cucumber-JVM
Test automation with Cucumber-JVM
 
Enough with the javas cript already! de Nicholas Zakas
Enough with the javas cript already! de Nicholas ZakasEnough with the javas cript already! de Nicholas Zakas
Enough with the javas cript already! de Nicholas Zakas
 
Story Driven Development With Cucumber
Story Driven Development With CucumberStory Driven Development With Cucumber
Story Driven Development With Cucumber
 
RSpec User Stories
RSpec User StoriesRSpec User Stories
RSpec User Stories
 
Understanding and testing restful web services
Understanding and testing restful web servicesUnderstanding and testing restful web services
Understanding and testing restful web services
 
Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011
 
Disrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsDisrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applications
 
Chanhao Jiang And David Wei Presentation Quickling Pagecache
Chanhao Jiang And David Wei Presentation Quickling PagecacheChanhao Jiang And David Wei Presentation Quickling Pagecache
Chanhao Jiang And David Wei Presentation Quickling Pagecache
 
Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWeb
 
Front-End Single Point of Failure - Velocity 2016 Training
Front-End Single Point of Failure - Velocity 2016 TrainingFront-End Single Point of Failure - Velocity 2016 Training
Front-End Single Point of Failure - Velocity 2016 Training
 
Gherkin for test automation in agile
Gherkin for test automation in agileGherkin for test automation in agile
Gherkin for test automation in agile
 
Selenium - The page object pattern
Selenium - The page object patternSelenium - The page object pattern
Selenium - The page object pattern
 
Scalable web application architecture
Scalable web application architectureScalable web application architecture
Scalable web application architecture
 
Writing automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjectsWriting automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjects
 
Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with Cucumber
 
WebApp / SPA @ AllFacebook Developer Conference
WebApp / SPA @ AllFacebook Developer ConferenceWebApp / SPA @ AllFacebook Developer Conference
WebApp / SPA @ AllFacebook Developer Conference
 

Andere mochten auch

Nhập môn BDD
Nhập môn BDDNhập môn BDD
Nhập môn BDD
Ngoc Dao
 

Andere mochten auch (20)

Behavior Driven Development (BDD)
Behavior Driven Development (BDD)Behavior Driven Development (BDD)
Behavior Driven Development (BDD)
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven Development
 
Nhập môn BDD
Nhập môn BDDNhập môn BDD
Nhập môn BDD
 
Phát triển hướng hành vi - Behavior Driven Development - BDD
Phát triển hướng hành vi - Behavior Driven Development - BDDPhát triển hướng hành vi - Behavior Driven Development - BDD
Phát triển hướng hành vi - Behavior Driven Development - BDD
 
Selenium basic
Selenium basicSelenium basic
Selenium basic
 
Bdd and-testing
Bdd and-testingBdd and-testing
Bdd and-testing
 
Selenium topic 1- Selenium Basic
Selenium topic 1-  Selenium BasicSelenium topic 1-  Selenium Basic
Selenium topic 1- Selenium Basic
 
BDD in Automation Testing
BDD in Automation TestingBDD in Automation Testing
BDD in Automation Testing
 
Automated Tests in Agile based on Serenity BDD - Michał Szybalski
Automated Tests in Agile based on Serenity BDD - Michał SzybalskiAutomated Tests in Agile based on Serenity BDD - Michał Szybalski
Automated Tests in Agile based on Serenity BDD - Michał Szybalski
 
Serenity BDD Workshop - 9th March 2016
Serenity BDD Workshop - 9th March 2016Serenity BDD Workshop - 9th March 2016
Serenity BDD Workshop - 9th March 2016
 
Ui BDD Testing
Ui BDD TestingUi BDD Testing
Ui BDD Testing
 
Serenity BDD - from executable specifications to living documentation
Serenity BDD - from executable specifications to living documentationSerenity BDD - from executable specifications to living documentation
Serenity BDD - from executable specifications to living documentation
 
Selenium
SeleniumSelenium
Selenium
 
Test Automation Frameworks: Assumptions, Concepts & Tools
Test Automation Frameworks: Assumptions, Concepts & ToolsTest Automation Frameworks: Assumptions, Concepts & Tools
Test Automation Frameworks: Assumptions, Concepts & Tools
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
 
Behavior Driven Development - Live Webinar
Behavior Driven Development - Live WebinarBehavior Driven Development - Live Webinar
Behavior Driven Development - Live Webinar
 
Serenity-BDD training
Serenity-BDD trainingSerenity-BDD training
Serenity-BDD training
 
Selenium topic 3 -Web Driver Basics
Selenium topic 3 -Web Driver BasicsSelenium topic 3 -Web Driver Basics
Selenium topic 3 -Web Driver Basics
 
BDD presentation
BDD presentationBDD presentation
BDD presentation
 
Basic Selenium Training
Basic Selenium TrainingBasic Selenium Training
Basic Selenium Training
 

Ähnlich wie [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

ppt_project_group_2.ppt amnd project report
ppt_project_group_2.ppt amnd project reportppt_project_group_2.ppt amnd project report
ppt_project_group_2.ppt amnd project report
sobanmoriwala1
 
Google external login setup in ASP (1).pdf
Google external login setup in ASP  (1).pdfGoogle external login setup in ASP  (1).pdf
Google external login setup in ASP (1).pdf
findandsolve .com
 
QuickConnect
QuickConnectQuickConnect
QuickConnect
Annu G
 
Agile methodologies based on BDD and CI by Nikolai Shevchenko
Agile methodologies based on BDD and CI by Nikolai ShevchenkoAgile methodologies based on BDD and CI by Nikolai Shevchenko
Agile methodologies based on BDD and CI by Nikolai Shevchenko
Moldova ICT Summit
 

Ähnlich wie [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber (20)

How React Native Appium and me made each other shine
How React Native Appium and me made each other shineHow React Native Appium and me made each other shine
How React Native Appium and me made each other shine
 
Lipstick on a Magical Pony: dynamic web pages without Javascript
Lipstick on a Magical Pony: dynamic web pages without JavascriptLipstick on a Magical Pony: dynamic web pages without Javascript
Lipstick on a Magical Pony: dynamic web pages without Javascript
 
Introduce cucumber
Introduce cucumberIntroduce cucumber
Introduce cucumber
 
Open microsoft visual studio/tutorialoutlet
Open microsoft visual studio/tutorialoutletOpen microsoft visual studio/tutorialoutlet
Open microsoft visual studio/tutorialoutlet
 
WordPress SugarCRM Customer Portal Pro Plugin
WordPress SugarCRM Customer Portal Pro PluginWordPress SugarCRM Customer Portal Pro Plugin
WordPress SugarCRM Customer Portal Pro Plugin
 
The Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt EakinThe Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt Eakin
 
Write Tests in End Users’ Lingo
Write Tests in End Users’ LingoWrite Tests in End Users’ Lingo
Write Tests in End Users’ Lingo
 
ppt_project_group_2.ppt amnd project report
ppt_project_group_2.ppt amnd project reportppt_project_group_2.ppt amnd project report
ppt_project_group_2.ppt amnd project report
 
Angular 2 binding
Angular 2  bindingAngular 2  binding
Angular 2 binding
 
O365con14 - a developer jam with yammer
O365con14 - a developer jam with yammerO365con14 - a developer jam with yammer
O365con14 - a developer jam with yammer
 
Documentation vs test about cucumber but not only for vegetarians
Documentation vs test about cucumber but not only for vegetariansDocumentation vs test about cucumber but not only for vegetarians
Documentation vs test about cucumber but not only for vegetarians
 
Deploy sql express and share point foundation
Deploy sql express and share point foundationDeploy sql express and share point foundation
Deploy sql express and share point foundation
 
Droidcon Paris: The new Android SDK
Droidcon Paris: The new Android SDKDroidcon Paris: The new Android SDK
Droidcon Paris: The new Android SDK
 
Google external login setup in ASP (1).pdf
Google external login setup in ASP  (1).pdfGoogle external login setup in ASP  (1).pdf
Google external login setup in ASP (1).pdf
 
Java script Advance
Java script   AdvanceJava script   Advance
Java script Advance
 
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
 
QuickConnect
QuickConnectQuickConnect
QuickConnect
 
The Web Components interoperability challenge - Horacio Gonzalez - Codemotion...
The Web Components interoperability challenge - Horacio Gonzalez - Codemotion...The Web Components interoperability challenge - Horacio Gonzalez - Codemotion...
The Web Components interoperability challenge - Horacio Gonzalez - Codemotion...
 
Polymer - pleasant client-side programming with web components
Polymer - pleasant client-side programming with web componentsPolymer - pleasant client-side programming with web components
Polymer - pleasant client-side programming with web components
 
Agile methodologies based on BDD and CI by Nikolai Shevchenko
Agile methodologies based on BDD and CI by Nikolai ShevchenkoAgile methodologies based on BDD and CI by Nikolai Shevchenko
Agile methodologies based on BDD and CI by Nikolai Shevchenko
 

Mehr von Ho Chi Minh City Software Testing Club

Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang PhiIntroduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Ho Chi Minh City Software Testing Club
 
Test Design with Action-based Testing Methodology - Ngo Hoang Minh
Test Design with Action-based Testing Methodology - Ngo Hoang MinhTest Design with Action-based Testing Methodology - Ngo Hoang Minh
Test Design with Action-based Testing Methodology - Ngo Hoang Minh
Ho Chi Minh City Software Testing Club
 
Analytical Risk-based and Specification-based Testing - Bui Duy Tam
Analytical Risk-based and Specification-based Testing - Bui Duy TamAnalytical Risk-based and Specification-based Testing - Bui Duy Tam
Analytical Risk-based and Specification-based Testing - Bui Duy Tam
Ho Chi Minh City Software Testing Club
 
[HCMC STC Jan 2015] Making IT Count – Agile Test Metrics
[HCMC STC Jan 2015] Making IT Count – Agile Test Metrics[HCMC STC Jan 2015] Making IT Count – Agile Test Metrics
[HCMC STC Jan 2015] Making IT Count – Agile Test Metrics
Ho Chi Minh City Software Testing Club
 

Mehr von Ho Chi Minh City Software Testing Club (20)

Web API Test Automation Using Frisby & Node.js
Web API Test Automation Using Frisby  & Node.jsWeb API Test Automation Using Frisby  & Node.js
Web API Test Automation Using Frisby & Node.js
 
Building an effective mobile testing strategy
Building an effective mobile testing strategyBuilding an effective mobile testing strategy
Building an effective mobile testing strategy
 
Common Web UI Problems Transforming Manual to Automation
Common Web UI Problems Transforming Manual to Automation Common Web UI Problems Transforming Manual to Automation
Common Web UI Problems Transforming Manual to Automation
 
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang PhiIntroduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
 
Test Design with Action-based Testing Methodology - Ngo Hoang Minh
Test Design with Action-based Testing Methodology - Ngo Hoang MinhTest Design with Action-based Testing Methodology - Ngo Hoang Minh
Test Design with Action-based Testing Methodology - Ngo Hoang Minh
 
Security testing-What can we do - Trinh Minh Hien
Security testing-What can we do - Trinh Minh HienSecurity testing-What can we do - Trinh Minh Hien
Security testing-What can we do - Trinh Minh Hien
 
Deliver Fast, Break Nothing Via Effective Building Developer and Tester Colla...
Deliver Fast, Break Nothing Via Effective Building Developer and Tester Colla...Deliver Fast, Break Nothing Via Effective Building Developer and Tester Colla...
Deliver Fast, Break Nothing Via Effective Building Developer and Tester Colla...
 
Analytical Risk-based and Specification-based Testing - Bui Duy Tam
Analytical Risk-based and Specification-based Testing - Bui Duy TamAnalytical Risk-based and Specification-based Testing - Bui Duy Tam
Analytical Risk-based and Specification-based Testing - Bui Duy Tam
 
Agile Testing - Not Just Tester’s Story _ Dang Thanh Long
Agile Testing - Not Just Tester’s Story _ Dang Thanh LongAgile Testing - Not Just Tester’s Story _ Dang Thanh Long
Agile Testing - Not Just Tester’s Story _ Dang Thanh Long
 
A Novel Approach of Automation Test for Software Monitoring Solution - Tran S...
A Novel Approach of Automation Test for Software Monitoring Solution - Tran S...A Novel Approach of Automation Test for Software Monitoring Solution - Tran S...
A Novel Approach of Automation Test for Software Monitoring Solution - Tran S...
 
Mobile Video Games Testing Principles - Benjamin Poirrier
Mobile Video Games Testing Principles - Benjamin PoirrierMobile Video Games Testing Principles - Benjamin Poirrier
Mobile Video Games Testing Principles - Benjamin Poirrier
 
The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...
The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...
The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...
 
Key Factors To Ensure Test Automation Framework Success
Key Factors To Ensure Test Automation Framework SuccessKey Factors To Ensure Test Automation Framework Success
Key Factors To Ensure Test Automation Framework Success
 
Why a Mobile Test Strategy is just Test Strategy
Why a Mobile Test Strategy is just Test StrategyWhy a Mobile Test Strategy is just Test Strategy
Why a Mobile Test Strategy is just Test Strategy
 
[HCMC STC Jan 2015] Risk-Based Software Testing Approaches
[HCMC STC Jan 2015] Risk-Based Software Testing Approaches[HCMC STC Jan 2015] Risk-Based Software Testing Approaches
[HCMC STC Jan 2015] Risk-Based Software Testing Approaches
 
[HCMC STC Jan 2015] FATS: A Framework For Automated Testing Scenarios
[HCMC STC Jan 2015] FATS: A Framework For Automated Testing Scenarios[HCMC STC Jan 2015] FATS: A Framework For Automated Testing Scenarios
[HCMC STC Jan 2015] FATS: A Framework For Automated Testing Scenarios
 
[HCMC STC Jan 2015] Practical Experiences In Test Automation
[HCMC STC Jan 2015] Practical Experiences In Test Automation[HCMC STC Jan 2015] Practical Experiences In Test Automation
[HCMC STC Jan 2015] Practical Experiences In Test Automation
 
[HCMC STC Jan 2015] Making IT Count – Agile Test Metrics
[HCMC STC Jan 2015] Making IT Count – Agile Test Metrics[HCMC STC Jan 2015] Making IT Count – Agile Test Metrics
[HCMC STC Jan 2015] Making IT Count – Agile Test Metrics
 
[HCMC STC Jan 2015] Workshop Of Context-Driven Testing In Agile
[HCMC STC Jan 2015] Workshop Of Context-Driven Testing In Agile[HCMC STC Jan 2015] Workshop Of Context-Driven Testing In Agile
[HCMC STC Jan 2015] Workshop Of Context-Driven Testing In Agile
 
[HCMC STC Jan 2015] Developing an Offshore Context-Driven Testing Team
[HCMC STC Jan 2015] Developing an Offshore Context-Driven Testing Team[HCMC STC Jan 2015] Developing an Offshore Context-Driven Testing Team
[HCMC STC Jan 2015] Developing an Offshore Context-Driven Testing Team
 

Kürzlich hochgeladen

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Kürzlich hochgeladen (20)

VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 

[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

  • 1. Behavior-Driven Development (BDD) And Automation Testing With Cucumber TRONG BUI & THONG NGUYEN STC 2014
  • 2. Sample Requirement Feature: login to the system. As a user, I want to login into the system when I provide username and password. Scenario: login successfully Given the login page is opening When I input username into the username textbox And I input valid password into the password textbox And I click Login button Then I am on the Home page 2
  • 3. Automation Test @Test public void fb_login_test() throws Exception { driver.get("https://www.facebook.com/"); driver.findElement(By.id("email")).clear(); driver.findElement(By.id("email")).sendKeys("bddtest@yahoo.com"); driver.findElement(By.id("pass")).clear(); driver.findElement(By.id("pass")).sendKeys("********"); driver.findElement(By.id("u_0_e")).click(); } 3
  • 4. Automation Test? Feature: login to the system. As a user, I want to login into the system when I provide username and password. Scenario: login successfully Given the login page is opening When I input username into the username textbox And I input valid password into the password textbox And I click Login button Then I am on the Home page 4
  • 6. AGENDA  Behavior-driven development  Automation Testing with Cucumber  BDD/Cucumber – Pros & Cons  Q&A 6
  • 11. Cucumber Approach 11 Given /^I launch "([^"]*)" page$/ do |page| visit(page) End When /^I fill in "([^"]*)" with "([^"]*)"$/ do |field, value| fill_in field, :with => value end Feature: Login to Email system. As an employee, I want to login into my email system with provided username and password. Scenario: Verify that employee could login email system Given I launch "https://accounts.google.com" page When I fill in “Email " with “hcmc-stc-12-jul@gmail.com" And I fill in “Passwd" with “hcmc-stc-passwd" And I click on "signIn" button Then I am on the “Home” page
  • 12. Scenario Example in BDD Format Feature: Login to Email system. As an employee, I want to login into my email system with provided username and password. Scenario: Verify that employee could login email system @tag_login_email Scenario Outline: Verify that can login gmail Given I launch "https://accounts.google.com" page When I fill in “Email " with “<Email >" And I fill in “Passwd" with "<Password> " And I click on "signIn" button Then I am on the “Home” page Scenarios: | Email | Password | | hcmc-stc-12-jul@gmail.com | hcmc-stc@2013| | hcmc-stc-user@gmail.com | hcmc-stc@1234| 12
  • 14. Demo • Web application: Cucumber + Capybara • Web services: Cucumber + HTTParty + Savon 14
  • 15. Demo: Web Application 15 Feature: Login to Email system. As an employee, I want to login into my email system with provided username and password. Scenario: Verify that employee could login email system @tag_login_email Scenario Outline: Verify that employee could login email system Given I launch "https://accounts.google.com" page When I fill in “Email " with “<Email >" And I fill in “Passwd" with "<Password> " And I click on "signIn" button Then I should see text "<Message>“ Scenarios: | Email | Password | Message | | demo01.hcmc.stc@gmail.com | demo@2013 | Primary Email demo01… | | demo02.hcmc.stc@gmail.com | demo1@1234 | Primary Email demo02… | | Nonexist.hcmc.stc@gmail.com | demo1@1234 | Invalid email or password|
  • 16. Demo: Web Services Feature: Get Weather status to display on webpage As an owner of Traveling Service, I want to be able to get weather status of any location based on address of client's request Scenario Outline: Get weather status by address of client's requests Given The check IP location and weather web services are running When I send request to get location detail of address "<Address>" Then I should have ZIP code and "<Country>" of that location And I send request to get weather status of that location by its ZIP code Then I should receive current "Temperature, Wind, RelativeHumidity" and "<City_Name>" and "<State>" of that location Scenarios: |Address |Country |City_Name |State | |www.google.com |United States |Mountain View |California| 16
  • 18. 18 BDD/Cucumber - Pros  BBD is FRIENDLY and UNDERSTANDABLE by non- technical users  Great support from RUBY community - Automation framework based BDD Cucumber is NOT REALLY HARD to develop and maintenance  Support on MULTIPLE PLATFORM, OS and different browsers
  • 19. 19 BDD/Cucumber - Cons  Incompatibility among GEM versions  Lacking of tool for managing Features and Scenarios effectively
  • 21. References 21 • All about BDD Cucumber: http://cukes.info/ • BDD cucumber book: http://www.amazon.com/The-Cucumber- Book-Behaviour-Driven-Development/dp/1934356808 • Ruby gems: http://rubygems.org • Ruby programming: http://www.ruby-lang.org
  • 22. © 2014 HCMC Software Testing Club THANK YOU