CUCUMBER
Yıldız MEHTAP
CUCUMBER
 Cucumber is a tool based on BDD (Behavior Driven Development)
framework.
 Behavior driven development is a software development
methodology in which an application is specified and designed by
describing how its behavior should appear to an outside
observer.
 It allows the developer to develop the test cases in a very easy
way, that everyone can understand.
 Cucumber was implemented in Ruby and later extended to Java.
 Cucumber can be used along with Selenium.
 Cucumber Supports many other languages like Perl, PHP, Python,
.Net etc.
 Cucumber is the most well known BDD framework.
Gherkin
 Cucumber executes your .feature files, and those files contain
executable specifications written in a language called Gherkin.
 Gherkin is designed to be easy to learn by non-programmers.
 The main keywords are:
o Feature,Scenario,Steps
(Given, When, Then, And, But),Background
o There are a few extra keywords as well: | (Data Tables),
@ (Tags), # (Comments)
 Feature
Each Gherkin file begins with the Feature keyword. This keyword
doesn’t really affect the behavior of your Cucumber tests at all; it
just gives you a convenient.
 Scenario
A scenario is a concrete example that illustrates a business rule.
It consists of a list of steps.
You can have as many steps as you like, but we recommend you
keep the number at 3-5 per scenario.
 Steps (Given, When, Then, And, But)
A step typically starts with Given, When or Then. If there are multiple
Given or When steps underneath each other, you can use And or But.
Cucumber does not differentiate between the keywords, but choosing
the right one is important for the readability of the scenario as a whole.
 Given : Diyelim ki (Login sayfasındayım.)
It describes the pre-requisite for the test to be executed.
 When : Eğer ki (Kullanıcı adı ve şifremi boş geçersem.)
It defines the trigger point for any test scenario execution.
 Then : O zaman (Hata almalıyım.)
Then holds the expected result for the test to be executed.
(verify/assert)
Use Given to put the system in a known state.
Use When to perform the user actions.
Use Then to verify the outcome.
 And
It provides the logical AND condition between any two
statements. AND can be used in conjunction with GIVEN, WHEN
and THEN statement.
 But
It signifies logical OR condition between any two statements. OR
can be used in conjunction with GIVEN, WHEN and THEN
statement.
 Background
Background generally has the instruction on what to setup
before each scenario runs.
 Big data
When writing Feature files, Doc Strings should be within
three adjacent quotes """ at the beginning and three at
the end.
 Integrating Cucumber with Junit
@RunWith(Cucumber.class)
Cucumber Options
Element Purpose Default
dryRun true (skips the execution of Glue Code) FALSE
Features These are the paths to the Feature(s) {}
Tags This is which Tags in the Features should
be executed
{}
monochrome This is whether or not to use monochrome
output
FALSE
plugin This declares what formatter(s) to use and
also miscellaneous options
{}
 Features
This option is used to specify the path to the Feature files.
When Cucumber starts execution, it looks for
the .Feature files at the path/folder mentioned in
the FEATURE option. Whichever files are with
the .Feature extension at the path mentioned in
the FEATURE option, are executed..
 Monochrome
If the monochrome option is set to false, then the
console output is not as readable as it should be.
 Tags
This option helps you decide which Tags in the Features
should be executed or, for that matter, which Tags should
not be executed.
 dryRun
If the dryRun option is set to true, Cucumber only
checks if all the Steps have their corresponding Step
Definitions defined and the code mentioned in the Step
Definitions is not executed and vice versa.
 Plugin
If you are expecting some Scenarios to fail, and want to
re-run the failed Scenarios, only then use the Rerunplugin.
This is what the code for @CucumberOptions looks like:
 Configuring the naming conventions
Cucumber lets the team choose the naming convention.
Depending on the naming convention, Cucumber
generates the method names for Step Definitions.
throw new PendingException();
When Cucumber encounters this statement, it understands that
these Steps are still a work in progress Step.
Step
Step definition
Regex
Expression Meaning
(.*) Match any string
(d+) Match any number
^ Any beginning of a string
$ Any end of a string
Step
Step definition
Step
Step definition
Cucumber
Thank you...
yildizmehtap91@gmail.com

More Related Content

PPT
How to test models using php unit testing framework?
PPT
Functional Testing Swing Applications with Frankenstein
PPT
Testing And Drupal
PPTX
Unit testing presentation
PPTX
Laravel Unit Testing
PPTX
Code igniter unittest-part1
PPTX
CodeIgniter Ant Scripting
ODP
PhpSpec: practical introduction
How to test models using php unit testing framework?
Functional Testing Swing Applications with Frankenstein
Testing And Drupal
Unit testing presentation
Laravel Unit Testing
Code igniter unittest-part1
CodeIgniter Ant Scripting
PhpSpec: practical introduction

What's hot (20)

PDF
JUnit 4 Can it still teach us something? - Andrzej Jóźwiak - Kariera IT Łodź ...
PDF
Testing Legacy Rails Apps
PPTX
Scripting robot
PDF
Test all the things! Automated testing with Drupal 8
PPTX
Code Igniter Code Sniffer
PDF
me-and-python
PPTX
Testing 101
PPTX
Automation testing with Drupal 8
PPTX
Automated php unit testing in drupal 8
PPTX
Byteman - Carving up your Java code
ODP
Practical byteman sample 20131128
PPT
Zend Framework 2 - PHPUnit
PPTX
Database Management Assignment Help
PDF
Unit-testing and E2E testing in JS
PDF
Unit testing for WordPress
ODP
Zombie chaser 0.1
PDF
Automated testing in Drupal
PPTX
Unit testing of java script and angularjs application using Karma Jasmine Fra...
PPT
Building a Driver: Lessons Learned From Developing the Internet Explorer Driver
JUnit 4 Can it still teach us something? - Andrzej Jóźwiak - Kariera IT Łodź ...
Testing Legacy Rails Apps
Scripting robot
Test all the things! Automated testing with Drupal 8
Code Igniter Code Sniffer
me-and-python
Testing 101
Automation testing with Drupal 8
Automated php unit testing in drupal 8
Byteman - Carving up your Java code
Practical byteman sample 20131128
Zend Framework 2 - PHPUnit
Database Management Assignment Help
Unit-testing and E2E testing in JS
Unit testing for WordPress
Zombie chaser 0.1
Automated testing in Drupal
Unit testing of java script and angularjs application using Karma Jasmine Fra...
Building a Driver: Lessons Learned From Developing the Internet Explorer Driver
Ad

Viewers also liked (17)

PPTX
Anatomy of stem,root and leaf of rice
PPTX
Sex expression in cucurbits
PPTX
Breeding of Bottlegourd & Bittergourd
PPTX
PDF
Cucumber ppt
PPTX
Capsicum - Greenhouse production
PPTX
Greenhouse production of Cucumber
ODP
Plant physiology
PDF
PPT
Photosynthesis ppt
PDF
Behavior Driven Development with Cucumber
PPTX
Photosynthesis
PPT
Photosynthesis
PPTX
Photosynthesis Powerpoint
DOC
Geography sba
PPTX
Presentation on morphology of rice plant
PPTX
Slideshare ppt
Anatomy of stem,root and leaf of rice
Sex expression in cucurbits
Breeding of Bottlegourd & Bittergourd
Cucumber ppt
Capsicum - Greenhouse production
Greenhouse production of Cucumber
Plant physiology
Photosynthesis ppt
Behavior Driven Development with Cucumber
Photosynthesis
Photosynthesis
Photosynthesis Powerpoint
Geography sba
Presentation on morphology of rice plant
Slideshare ppt
Ad

Similar to Cucumber (20)

PPT
Cucumber presentation
PPTX
BDD using Cucumber JVM
PDF
Master Cucumber cheat sheet for testing .pdf
PDF
Top 20 Cucumber interview questions and answers in 2023.pdf
DOC
Tortuga-A simulation software
PPT
SMI - Introduction to Java
ODP
Simple test drupal7_presentation_la_drupal_jul21-2010
PDF
cucumber harpal.pdf
PPTX
Top 20 cucumber interview questions for sdet
PPTX
Uft Basics
PDF
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
PDF
A Comprehensive Guide to Essential Workflows for Improving Flutter Unit Testi...
PPTX
presentation des google mock dans un contexte de tdd
PPTX
DevLabs Alliance top 20 Cucumber Interview Questions for SDET
PPTX
DevLabs Alliance top 20 Cucumber Interview Questions for SDET
PDF
JavaScript - Chapter 15 - Debugging Techniques
DOCX
Selenium interview-questions-freshers
PDF
Different Techniques Of Debugging Selenium Based Test Scripts.pdf
PDF
PhyloPipe.v1.1_manual_20150610
Cucumber presentation
BDD using Cucumber JVM
Master Cucumber cheat sheet for testing .pdf
Top 20 Cucumber interview questions and answers in 2023.pdf
Tortuga-A simulation software
SMI - Introduction to Java
Simple test drupal7_presentation_la_drupal_jul21-2010
cucumber harpal.pdf
Top 20 cucumber interview questions for sdet
Uft Basics
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
A Comprehensive Guide to Essential Workflows for Improving Flutter Unit Testi...
presentation des google mock dans un contexte de tdd
DevLabs Alliance top 20 Cucumber Interview Questions for SDET
DevLabs Alliance top 20 Cucumber Interview Questions for SDET
JavaScript - Chapter 15 - Debugging Techniques
Selenium interview-questions-freshers
Different Techniques Of Debugging Selenium Based Test Scripts.pdf
PhyloPipe.v1.1_manual_20150610

Recently uploaded (20)

PPTX
Human-Computer Interaction for Lecture 2
PPTX
string python Python Strings: Literals, Slicing, Methods, Formatting, and Pra...
PPTX
Presentation by Samna Perveen And Subhan Afzal.pptx
PPTX
Plex Media Server 1.28.2.6151 With Crac5 2022 Free .
PDF
Internet Download Manager IDM Crack powerful download accelerator New Version...
PDF
Cloud Native Aachen Meetup - Aug 21, 2025
PPT
3.Software Design for software engineering
PPTX
Download Adobe Photoshop Crack 2025 Free
PDF
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
PDF
Crypto Loss And Recovery Guide By Expert Recovery Agency.
PPTX
Viber For Windows 25.7.1 Crack + Serial Keygen
PDF
MiniTool Power Data Recovery 12.6 Crack + Portable (Latest Version 2025)
PPTX
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
PPTX
Folder Lock 10.1.9 Crack With Serial Key
PDF
PDF-XChange Editor Plus 10.7.0.398.0 Crack Free Download Latest 2025
PPTX
Odoo ERP for Injection Molding Industry – Optimize Production & Reduce Scrap
PDF
BoxLang Dynamic AWS Lambda - Japan Edition
PPTX
Streamlining Project Management in the AV Industry with D-Tools for Zoho CRM ...
PPTX
Python is a high-level, interpreted programming language
PPTX
4Seller: The All-in-One Multi-Channel E-Commerce Management Platform for Glob...
Human-Computer Interaction for Lecture 2
string python Python Strings: Literals, Slicing, Methods, Formatting, and Pra...
Presentation by Samna Perveen And Subhan Afzal.pptx
Plex Media Server 1.28.2.6151 With Crac5 2022 Free .
Internet Download Manager IDM Crack powerful download accelerator New Version...
Cloud Native Aachen Meetup - Aug 21, 2025
3.Software Design for software engineering
Download Adobe Photoshop Crack 2025 Free
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
Crypto Loss And Recovery Guide By Expert Recovery Agency.
Viber For Windows 25.7.1 Crack + Serial Keygen
MiniTool Power Data Recovery 12.6 Crack + Portable (Latest Version 2025)
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
Folder Lock 10.1.9 Crack With Serial Key
PDF-XChange Editor Plus 10.7.0.398.0 Crack Free Download Latest 2025
Odoo ERP for Injection Molding Industry – Optimize Production & Reduce Scrap
BoxLang Dynamic AWS Lambda - Japan Edition
Streamlining Project Management in the AV Industry with D-Tools for Zoho CRM ...
Python is a high-level, interpreted programming language
4Seller: The All-in-One Multi-Channel E-Commerce Management Platform for Glob...

Cucumber

  • 2. CUCUMBER  Cucumber is a tool based on BDD (Behavior Driven Development) framework.  Behavior driven development is a software development methodology in which an application is specified and designed by describing how its behavior should appear to an outside observer.
  • 3.  It allows the developer to develop the test cases in a very easy way, that everyone can understand.  Cucumber was implemented in Ruby and later extended to Java.  Cucumber can be used along with Selenium.  Cucumber Supports many other languages like Perl, PHP, Python, .Net etc.  Cucumber is the most well known BDD framework.
  • 4. Gherkin  Cucumber executes your .feature files, and those files contain executable specifications written in a language called Gherkin.  Gherkin is designed to be easy to learn by non-programmers.  The main keywords are: o Feature,Scenario,Steps (Given, When, Then, And, But),Background o There are a few extra keywords as well: | (Data Tables), @ (Tags), # (Comments)
  • 5.  Feature Each Gherkin file begins with the Feature keyword. This keyword doesn’t really affect the behavior of your Cucumber tests at all; it just gives you a convenient.  Scenario A scenario is a concrete example that illustrates a business rule. It consists of a list of steps. You can have as many steps as you like, but we recommend you keep the number at 3-5 per scenario.
  • 6.  Steps (Given, When, Then, And, But) A step typically starts with Given, When or Then. If there are multiple Given or When steps underneath each other, you can use And or But. Cucumber does not differentiate between the keywords, but choosing the right one is important for the readability of the scenario as a whole.  Given : Diyelim ki (Login sayfasındayım.) It describes the pre-requisite for the test to be executed.  When : Eğer ki (Kullanıcı adı ve şifremi boş geçersem.) It defines the trigger point for any test scenario execution.  Then : O zaman (Hata almalıyım.) Then holds the expected result for the test to be executed. (verify/assert) Use Given to put the system in a known state. Use When to perform the user actions. Use Then to verify the outcome.
  • 7.  And It provides the logical AND condition between any two statements. AND can be used in conjunction with GIVEN, WHEN and THEN statement.  But It signifies logical OR condition between any two statements. OR can be used in conjunction with GIVEN, WHEN and THEN statement.  Background Background generally has the instruction on what to setup before each scenario runs.
  • 8.  Big data When writing Feature files, Doc Strings should be within three adjacent quotes """ at the beginning and three at the end.  Integrating Cucumber with Junit @RunWith(Cucumber.class)
  • 9. Cucumber Options Element Purpose Default dryRun true (skips the execution of Glue Code) FALSE Features These are the paths to the Feature(s) {} Tags This is which Tags in the Features should be executed {} monochrome This is whether or not to use monochrome output FALSE plugin This declares what formatter(s) to use and also miscellaneous options {}
  • 10.  Features This option is used to specify the path to the Feature files. When Cucumber starts execution, it looks for the .Feature files at the path/folder mentioned in the FEATURE option. Whichever files are with the .Feature extension at the path mentioned in the FEATURE option, are executed..
  • 11.  Monochrome If the monochrome option is set to false, then the console output is not as readable as it should be.
  • 12.  Tags This option helps you decide which Tags in the Features should be executed or, for that matter, which Tags should not be executed.
  • 13.  dryRun If the dryRun option is set to true, Cucumber only checks if all the Steps have their corresponding Step Definitions defined and the code mentioned in the Step Definitions is not executed and vice versa.
  • 14.  Plugin If you are expecting some Scenarios to fail, and want to re-run the failed Scenarios, only then use the Rerunplugin. This is what the code for @CucumberOptions looks like:
  • 15.  Configuring the naming conventions Cucumber lets the team choose the naming convention. Depending on the naming convention, Cucumber generates the method names for Step Definitions.
  • 16. throw new PendingException(); When Cucumber encounters this statement, it understands that these Steps are still a work in progress Step.
  • 17. Step Step definition Regex Expression Meaning (.*) Match any string (d+) Match any number ^ Any beginning of a string $ Any end of a string