Course
Cucumber Testing Tutorials for Beginners
Training Summary Behavior Driven Development (BDD) is a rising methodology to test and check your...
Cucumber installation could be tiresome but its relatively easy.
Here is a roadmap of components that need to be installed to make Cucumber work
Step1) Got to https://rubyinstaller.org/downloads/
Step 2) Open the downloaded file.
Step 3) In next screen.
Step 4) In the following screen, Click on Next
Step 5) Wait for installation to complete.
Step 6) Click Finish
Step 7) Once installation is complete, Lets Run Ruby!
Step 8) You will see Ruby Command prompt similar to Windows cmd.
Step 1) Type in Ruby cmd "gem install cucumber". This command will download and install Cucumber at command line itself
After few seconds cucumber installation procedure has been start
Step 2) To verify cucumber is installed successfully or not just type "cucumber –version"
Step 1)
Step 2)
Step 3)
Step 4)
Step 5)
Step 6)
Step 7)
Step 8)
Step 9)
Step 10)
Step 11)
Step 12)
Step 1) Click on "Start Command Prompt With ruby" and install command "gem install watir-webdriver"
Step 2) watir-webdriver install successfully
Step 1) Open RubyMine Editor via windows start menu
You will See Rubymine Dashboard as below
Step 2) Create a new project in Rubymine editor
Step 3) create a file directory
Step 4) create and Save File in "yourfolder/features/" with name "yourfilename.feature"
Step 5) To execute our scenario, save the following commands in the Feature File
Code:
Feature: Multiplication I multiply two numbers Scenario: multiply a and b Given I have variable a And I have variable b When I multiplication a and b Then I display the Result
Step 6) Now lets Run our First feature file.!
Click on "Start Command Prompt With ruby"
It will look like this!
Step 7) Lets create step definition file for our Feature File!
Create a new folder in Rubymine editor
Step 8) Save File As below in "yourfolder/features/step_definititons" with name test_step.rb
Step 9) Write the following code into the step file
Code :
Given(/^I have variable a$/) do
@a = 50
end
And(/^I have variable b$/) do
@b = 70
end
When(/^I multiplication a and b$/) do
@mul = @a * @b
end
Then(/^I display the Result$/) do
puts "Multiplication of #{@a} and #{@b} is #{@mul}"
end
Step 10) Now, again run our feature file:
The result is
Training Summary Behavior Driven Development (BDD) is a rising methodology to test and check your...
What is Cucumber? Cucumber is a testing tool that supports Behavior Driven Development (BDD). It...
For every cucumber project there is a single directory at the root of the project named " features...
In this tutorial, we will create Cucumber Scripts to test two scenarios Cucumber Script 1:...
What is Gherkin Language? Gherkin is a business readable language which helps you to describe...