SlideShare a Scribd company logo
1 of 22
Vishwanath KC
TDD VS BDD
TDD
What is Cucumber
• Cucumber is a testing tool that supports Behavior Driven
Development (BDD). It offers a way to write tests that anybody can
understand, regardless of their technical knowledge.
Flow of the Project
Prerequisite for Cucumber
with Selenium
• Java (JDK, JRE)
• Install IDE – Eclipse
• Selenium jar files
• Selenium-server-standalone
• Jar files For Cucumber
• Cucumber-core
• Cucumber-html
• cobertura code coverage
• Cucumber-java
• Cucumber-junit
• Cucumber-jvm-deps
• Cucumber-reporting
• Hemcrest-core
• Gherkin
• Junit
Project Structure
For every cucumber project there is a single directory at
the root of the project named "features". This is where all
of your cucumber features will reside. In this directory you
will find additional directories, which is step_definition
and support directories (testRunner).
What is "Feature File"?
• Features file contain high level description of the Test Scenario
in simple language. It is known as Gherkin. Gherkin is a plain
English text language
Feature File consist of following components -
• Feature: A feature would describe the current test script which has to be
executed.
• Scenario: Scenario describes the steps and expected outcome for a
particular test case.
• Scenario Outline: Same scenario can be executed for multiple sets of data
using scenario outline. The data is provided by a tabular structure separated
by (I I).
Scenario
• Given: It specifies the context of the text to be executed.
By using data tables "Given", step can also be
parameterized.
• When: "When" specifies the test action that has to
performed
• Then: The expected outcome of the test can be
represented by "Then"
Gherkin Syntax
Gherkin is line-oriented language, Each line called step and starts with
keyword and end of the terminals with a stop. Tab or space are used for
the indentation.
Typical Gherkin steps look like:
Gherkin Scripts: connects the human concept of cause and effect to the
software concept of input/process/output.
Important Terms used in Gherkin
• Feature
• Background
• Scenario
• Given
• When
• Then
• And
• But
Gherkin Examples
Scenario Outline
Best practices
• Each scenario should execute separately
• Every feature should able to be executed along
• Steps information should be shown independently
• Connect your Scenario's with your requirements
• Keep a complete track of what scenarios should be included in a
requirement document
• Create modular and easy to understand steps
• Try to combine all your common scenarios
Advantages of Gherkin
• Gherkin is simple enough for non-programmers to understand and It
makes User Stories easier to digest
• Gherkin script can easily understand by business executives and
developers and they can use it to start their tests
• A significant proportion of the functional specifications is written as
user stories
• You don't need to be expert to understand the small Gherkin
command set
• Gherkin Test cases link acceptance tests directly to automated tests
• Style of writing tests cases are easier to reuse code in other tests
• It requires a high level of business engagement and collaborations
• May not work well in all scenarios
• Poorly written tests can easily increase test-maintenance cost
Dis-Advantages of Gherkin
Exercise
• Fund Transfer should take place if there is enough balance in
source account
• Fund Transfer should take place if the destination a/c details
are correct
• Fund Transfer should take place if transaction password / rsa
code / security authentication for the transaction entered by
user is correct
• Fund Transfer should take place even if it's a Bank Holiday
• Fund Transfer should take place on a future date as set by the
account holder
Solution
Structure and Execution
Cont’d
Cont’d
Cucumber With Selenium

More Related Content

What's hot

Automation test framework with cucumber – BDD
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD123abcda
 
UI Testing Automation
UI Testing AutomationUI Testing Automation
UI Testing AutomationAgileEngine
 
Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)Mindfire Solutions
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using seleniumshreyas JC
 
Introduction to Selenium Automation
Introduction to Selenium AutomationIntroduction to Selenium Automation
Introduction to Selenium AutomationMindfire Solutions
 
BDD testing with cucumber
BDD testing with cucumberBDD testing with cucumber
BDD testing with cucumberDaniel Kummer
 
Automated testing with Cypress
Automated testing with CypressAutomated testing with Cypress
Automated testing with CypressYong Shean Chong
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumberNibu Baby
 
Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...
Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...
Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...Simplilearn
 
What Is Cucumber?
What Is Cucumber?What Is Cucumber?
What Is Cucumber?QATestLab
 
Test Automation and Selenium
Test Automation and SeleniumTest Automation and Selenium
Test Automation and SeleniumKarapet Sarkisyan
 
How to Get Started with Cypress
How to Get Started with CypressHow to Get Started with Cypress
How to Get Started with CypressApplitools
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using SeleniumNaresh Chintalcheru
 

What's hot (20)

Automation test framework with cucumber – BDD
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD
 
UI Testing Automation
UI Testing AutomationUI Testing Automation
UI Testing Automation
 
Testing Angular
Testing AngularTesting Angular
Testing Angular
 
Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
 
Cucumber BDD
Cucumber BDDCucumber BDD
Cucumber BDD
 
Introduction to Selenium Automation
Introduction to Selenium AutomationIntroduction to Selenium Automation
Introduction to Selenium Automation
 
BDD testing with cucumber
BDD testing with cucumberBDD testing with cucumber
BDD testing with cucumber
 
Automated testing with Cypress
Automated testing with CypressAutomated testing with Cypress
Automated testing with Cypress
 
Cucumber presenation
Cucumber presenationCucumber presenation
Cucumber presenation
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumber
 
Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...
Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...
Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...
 
Selenium WebDriver
Selenium WebDriverSelenium WebDriver
Selenium WebDriver
 
What Is Cucumber?
What Is Cucumber?What Is Cucumber?
What Is Cucumber?
 
Test Automation and Selenium
Test Automation and SeleniumTest Automation and Selenium
Test Automation and Selenium
 
How to Get Started with Cypress
How to Get Started with CypressHow to Get Started with Cypress
How to Get Started with Cypress
 
Selenium
SeleniumSelenium
Selenium
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using Selenium
 
Devops | CICD Pipeline
Devops | CICD PipelineDevops | CICD Pipeline
Devops | CICD Pipeline
 
Automated Test Framework with Cucumber
Automated Test Framework with CucumberAutomated Test Framework with Cucumber
Automated Test Framework with Cucumber
 

Similar to Cucumber With Selenium

MyHeritage - QA Automations in a Continuous Deployment environment
MyHeritage -  QA Automations in a Continuous Deployment environmentMyHeritage -  QA Automations in a Continuous Deployment environment
MyHeritage - QA Automations in a Continuous Deployment environmentMatanGoren
 
Autoframework design
Autoframework designAutoframework design
Autoframework designForge Events
 
Testing with cucumber testing framework
Testing with cucumber testing frameworkTesting with cucumber testing framework
Testing with cucumber testing frameworkAIMDek Technologies
 
MyHeritage - End 2 End testing Infra
MyHeritage - End 2 End testing InfraMyHeritage - End 2 End testing Infra
MyHeritage - End 2 End testing InfraMatanGoren
 
#ATAGTR2020 Presentation - Universal Test Automation Framework
#ATAGTR2020 Presentation - Universal Test Automation Framework#ATAGTR2020 Presentation - Universal Test Automation Framework
#ATAGTR2020 Presentation - Universal Test Automation FrameworkAgile Testing Alliance
 
Tools for Software Testing
Tools for Software TestingTools for Software Testing
Tools for Software TestingMohammed Moishin
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by ExampleNalin Goonawardana
 
Enter the mind of an Agile Developer
Enter the mind of an Agile DeveloperEnter the mind of an Agile Developer
Enter the mind of an Agile DeveloperBSGAfrica
 
Driving application development through behavior driven development
Driving application development through behavior driven developmentDriving application development through behavior driven development
Driving application development through behavior driven developmentEinar Ingebrigtsen
 
Introducing BDD and TDD with Cucumber
Introducing BDD and TDD with CucumberIntroducing BDD and TDD with Cucumber
Introducing BDD and TDD with CucumberKnoldus Inc.
 
Client Side Unit Testing
Client Side Unit TestingClient Side Unit Testing
Client Side Unit Testingcloud chen
 
BDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVABDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVASrinivas Katakam
 
Spec(ing) Out Your Workflow with SpecFlow
Spec(ing) Out Your Workflow with SpecFlowSpec(ing) Out Your Workflow with SpecFlow
Spec(ing) Out Your Workflow with SpecFlowSarah Dutkiewicz
 

Similar to Cucumber With Selenium (20)

Gherkin model1
Gherkin model1Gherkin model1
Gherkin model1
 
Gherkin model BDD
Gherkin model BDDGherkin model BDD
Gherkin model BDD
 
MyHeritage - QA Automations in a Continuous Deployment environment
MyHeritage -  QA Automations in a Continuous Deployment environmentMyHeritage -  QA Automations in a Continuous Deployment environment
MyHeritage - QA Automations in a Continuous Deployment environment
 
Autoframework design
Autoframework designAutoframework design
Autoframework design
 
Kku2011
Kku2011Kku2011
Kku2011
 
Testing with cucumber testing framework
Testing with cucumber testing frameworkTesting with cucumber testing framework
Testing with cucumber testing framework
 
MyHeritage - End 2 End testing Infra
MyHeritage - End 2 End testing InfraMyHeritage - End 2 End testing Infra
MyHeritage - End 2 End testing Infra
 
Devops
DevopsDevops
Devops
 
#ATAGTR2020 Presentation - Universal Test Automation Framework
#ATAGTR2020 Presentation - Universal Test Automation Framework#ATAGTR2020 Presentation - Universal Test Automation Framework
#ATAGTR2020 Presentation - Universal Test Automation Framework
 
Enterprise PHP
Enterprise PHPEnterprise PHP
Enterprise PHP
 
Tools for Software Testing
Tools for Software TestingTools for Software Testing
Tools for Software Testing
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by Example
 
Enter the mind of an Agile Developer
Enter the mind of an Agile DeveloperEnter the mind of an Agile Developer
Enter the mind of an Agile Developer
 
cucumber harpal.pdf
cucumber harpal.pdfcucumber harpal.pdf
cucumber harpal.pdf
 
Cucumber_Training_ForQA
Cucumber_Training_ForQACucumber_Training_ForQA
Cucumber_Training_ForQA
 
Driving application development through behavior driven development
Driving application development through behavior driven developmentDriving application development through behavior driven development
Driving application development through behavior driven development
 
Introducing BDD and TDD with Cucumber
Introducing BDD and TDD with CucumberIntroducing BDD and TDD with Cucumber
Introducing BDD and TDD with Cucumber
 
Client Side Unit Testing
Client Side Unit TestingClient Side Unit Testing
Client Side Unit Testing
 
BDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVABDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVA
 
Spec(ing) Out Your Workflow with SpecFlow
Spec(ing) Out Your Workflow with SpecFlowSpec(ing) Out Your Workflow with SpecFlow
Spec(ing) Out Your Workflow with SpecFlow
 

More from Vishwanath KC

More from Vishwanath KC (7)

Introduction to Agile Scrum Methodology
Introduction to Agile Scrum MethodologyIntroduction to Agile Scrum Methodology
Introduction to Agile Scrum Methodology
 
Api Testing
Api TestingApi Testing
Api Testing
 
Api Testing
Api TestingApi Testing
Api Testing
 
Automation frameworks
Automation frameworksAutomation frameworks
Automation frameworks
 
Time management
Time managementTime management
Time management
 
Non-functional testing
Non-functional testingNon-functional testing
Non-functional testing
 
Jasmine framework
Jasmine frameworkJasmine framework
Jasmine framework
 

Recently uploaded

The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxnada99848
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 

Recently uploaded (20)

The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptx
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 

Cucumber With Selenium

  • 3. TDD
  • 4. What is Cucumber • Cucumber is a testing tool that supports Behavior Driven Development (BDD). It offers a way to write tests that anybody can understand, regardless of their technical knowledge.
  • 5. Flow of the Project
  • 6. Prerequisite for Cucumber with Selenium • Java (JDK, JRE) • Install IDE – Eclipse • Selenium jar files • Selenium-server-standalone • Jar files For Cucumber • Cucumber-core • Cucumber-html • cobertura code coverage • Cucumber-java • Cucumber-junit • Cucumber-jvm-deps • Cucumber-reporting • Hemcrest-core • Gherkin • Junit
  • 7. Project Structure For every cucumber project there is a single directory at the root of the project named "features". This is where all of your cucumber features will reside. In this directory you will find additional directories, which is step_definition and support directories (testRunner).
  • 8. What is "Feature File"? • Features file contain high level description of the Test Scenario in simple language. It is known as Gherkin. Gherkin is a plain English text language Feature File consist of following components - • Feature: A feature would describe the current test script which has to be executed. • Scenario: Scenario describes the steps and expected outcome for a particular test case. • Scenario Outline: Same scenario can be executed for multiple sets of data using scenario outline. The data is provided by a tabular structure separated by (I I).
  • 9. Scenario • Given: It specifies the context of the text to be executed. By using data tables "Given", step can also be parameterized. • When: "When" specifies the test action that has to performed • Then: The expected outcome of the test can be represented by "Then"
  • 10. Gherkin Syntax Gherkin is line-oriented language, Each line called step and starts with keyword and end of the terminals with a stop. Tab or space are used for the indentation. Typical Gherkin steps look like: Gherkin Scripts: connects the human concept of cause and effect to the software concept of input/process/output. Important Terms used in Gherkin • Feature • Background • Scenario • Given • When • Then • And • But
  • 11.
  • 14. Best practices • Each scenario should execute separately • Every feature should able to be executed along • Steps information should be shown independently • Connect your Scenario's with your requirements • Keep a complete track of what scenarios should be included in a requirement document • Create modular and easy to understand steps • Try to combine all your common scenarios
  • 15. Advantages of Gherkin • Gherkin is simple enough for non-programmers to understand and It makes User Stories easier to digest • Gherkin script can easily understand by business executives and developers and they can use it to start their tests • A significant proportion of the functional specifications is written as user stories • You don't need to be expert to understand the small Gherkin command set • Gherkin Test cases link acceptance tests directly to automated tests • Style of writing tests cases are easier to reuse code in other tests • It requires a high level of business engagement and collaborations • May not work well in all scenarios • Poorly written tests can easily increase test-maintenance cost Dis-Advantages of Gherkin
  • 16.
  • 17. Exercise • Fund Transfer should take place if there is enough balance in source account • Fund Transfer should take place if the destination a/c details are correct • Fund Transfer should take place if transaction password / rsa code / security authentication for the transaction entered by user is correct • Fund Transfer should take place even if it's a Bank Holiday • Fund Transfer should take place on a future date as set by the account holder