0% found this document useful (0 votes)
117 views9 pages

Cucumber BDD with Selenium Guide

Cucumber is a software tool that supports behavior-driven development (BDD). It allows test cases to be written in plain language like English ("Gherkin") so that they can be understood by both technical and non-technical teams. Cucumber uses feature files to define test scenarios in Gherkin syntax. Step definition files link the Gherkin steps to code that implements the test behavior. A test runner file is used to execute JUnit tests that run the scenarios defined in the feature files.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
117 views9 pages

Cucumber BDD with Selenium Guide

Cucumber is a software tool that supports behavior-driven development (BDD). It allows test cases to be written in plain language like English ("Gherkin") so that they can be understood by both technical and non-technical teams. Cucumber uses feature files to define test scenarios in Gherkin syntax. Step definition files link the Gherkin steps to code that implements the test behavior. A test runner file is used to execute JUnit tests that run the scenarios defined in the feature files.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
  • Cucumber with Selenium Java (BDD Testing)
  • What is Cucumber
  • BDD Approach
  • Cucumber Installation
  • Gherkin Syntax
  • Feature File - Gherkin Language
  • Step Definition File
  • TestRunner File
  • Cucumber Combined Practicals Links

Cucumber with Selenium

Java (BDD Testing)


What is Cucumber

Cucumber is a software tool, and it supports BDD(behavior-driven development).

Cucumber BDD tool is very popular in testing industry, mainly because of the
writing test cases in (High Level)plain ordinary language called Gherkin. It's like
writing test cases in “english language”

It uses the framework annotations to understand software behaviors to be


specified in a logical language which is intelligible to the users.(Specially from
non-coding background)
BDD Approach

“The behavior-driven development” (BDD) is:


an Agile software development process
which inspires a joint effort among developers, QA and non-technical or
business participants in the project.

Framework approach in automation. A framework for test automation, consist of


different modules and libraries.

They simply use the object-oriented approach, to provide us with an integrated


system or environment, where we can write our test case for the specific product.
Cucumber Installation

Here is a guide from where you can follow step by step instruction to integrate
Cucumber framework into your Eclipse IDE

Step-by-Step Instruction

Cucumber Dependencies

Download Jar Files


Gherkin syntax

Gherkin is a line-oriented language that uses indentation to define structure, with


line ending termination.(Also called Steps)
Feature: feature login feature of new website for testing

Scenario: login test for new website

Given I am on the demo website "[Link]

When I type login = "a" and password = "a"

And I click sign-in button

Then I should get "SIGN-OFF" link


Feature File - Gherkin Language

Create a file with extension feature - “[Link]”

Feature: test scenario to test google search page


Scenario: Search with different set of words
Given I am on google page "[Link]
When I type login = "<seachWords>"
And I click on google search button

Goto run as >> run [Link] file


Step Definition File

A step definition is java file responsible for actually working on the feature file. It
can be a Regular Expression or a Cucumber Expression.

The examples in this section use Cucumber Expressions.

Example Code
TestRunner File

A test runner file is responsible for running the JUnit test on your step definition file
including feature file.

Run as >> JUnit Tests

Example Code
Cucumber Combined Practicals Links

Basic Program

[Link]
sp=sharing

Login Program

[Link]
sp=sharing

Scenario Based Login

[Link]
p=sharing

Cucumber with Selenium 
Java (BDD Testing)
What is Cucumber 
Cucumber is a software tool, and it supports BDD(behavior-driven development).  
Cucumber BDD tool is very
BDD Approach 
“The behavior-driven development” (BDD) is: 
an Agile software development process 
which inspires a joint effo
Cucumber Installation 
Here is a guide from where you can follow step by (https://www.qaonlinetraining.com/wp-content/uploads
Gherkin syntax 
Gherkin is a line-oriented language that uses indentation to define structure, with 
line ending termination.
Feature File - Gherkin Language 
Create a file with extension feature - “search.feature” 
Feature: test scenario to test goog
Step Definition File 
A step definition is java file responsible for actually working on the feature file. It 
can be a Regul
TestRunner File 
A test runner file is responsible for running the JUnit test on your step definition file 
including feature
Cucumber Combined Practicals Links 
Basic Program 
https://drive.google.com/file/d/1gQuu2k5E4KJeEdGx5BEMjNhHa_nmo2k4/view?u (

You might also like