As we Know Cucumber is testing Framework, that used for Writing Acceptance testing for all Web Applications. By Following Basic Concept of Script test Cases in Human Understandable Language.
Here we can See the term, human language, that define plain Form of Structured Languages, that known as Gherkin.
Gherkin is used for Writing Cucumber Feature Files. It has been translated over 70 languages. If you ask, what is the Role of Cucumber here? We can Finish it with a phrase. That Cucumber is an open source tool.
This tool acts like Tough Bridge, that is in between, the test Result and Human Languages. It mainly concentrates on behaviour Driven Development method.
The cucumber Support so many languages like Ruby, Java, and Python.
Identically, cucumber is Integrated and Guided by so many Frameworks like Watir. Ruby on Rails, selenium, capybara.
What we need
We have to make sure, that have installed ruby on your System.
You can also download the chrome Driver, implement it here.
Now, Extract the Zip File and Make it Executable that is by using the following command.
chmod +x chromedriver
Then move the executable file to bin folder.
sudo mv chromedriver /bin
To get in-depth knowledge on Ruby Cucumber, you can enroll for live Ruby Cucumber online training by OnlineITGuru with 24/7 support and lifetime access
Setup
First, we have to Design a New Project for Cucumber Test.
mkdir cucumber-test
cd cucumber-test
Design a File Name with Germfile and after that add the following Gems to Germfile.
Then Design a File Name with Gemfile and then add the following gems to gemfile.
In addition to that, you get gems her that is http://rubygems.org
gem 'watir'
gem 'RSpec'
gem 'cucumber'
Then Operate Bundle Install to Install Germs for our complete testing Purpose.
$ bundle install
Cucumber – init for setting up Directory Design for Cucumber Project.
cucumber --init
create features
create features/step_definitions
create features/support
create features/support/env.rb
Therefore, add the following lines to features/support/Env.RB file
Here, in env.RB file we are Initializing after and before hooks.
Not to mention, in Starting hook will run the first step of Every Scenario and after hook. They will run the last Step of Every Scenario. When Steps were failed, pending and skipped.
require 'watir'
Before do
@browser = Watir::Browser.new :chrome
@browser.window.maximize
end
After do
@browser.close
end
require 'watir'
Before do
@browser = Watir::Browser.new :chrome
@browser.window.maximize
end
After do
@browser.close
End
Not to mention, here we added water in our Gemfile.
@browser = Watir::Browser.new :chrome -> invoking/opening chrome browser
Gherkin Keywords
But
And
Then
When
Given
Scenario
Background
Feature
Feature
The Gherkins Files start with keyboard known as Feature. In this section, we describe the functionality of Software Feature. The Description in Feature has no Special Meaning.
It will hold only important points like Software Features. It will not have any impact on Run-time and the Descriptions ignored.
Scenario
A Scenario is one of the core Gherkin Designs. That every Scenario starts with keyword Scenario. That followed by an optional Scenario title. It shows the specific test of Software Function.
It has many Steps that is like cucumber execute every step at a time.
Given
Given Step Describe, Initial State of the system. That when a cucumber executes, the step of the given. It will put the System in a known state before, by user communicating System.
When
When it was used for Describing An action or an Event.
Then
It was used for describing the expected result or an outcome. Then the step utilized like an Assertion for comparing actual outcome and Expected outcome.
But and And
This will be used, when we use multiple Given, Then and when Statements.
Feature
In cucumber, every test cases Written in Feature files. Features File will have an Extension of Feature. For the First time of Feature File Starts with a keyboard Feature. Every Feature file has Single Feature.
The feature contains one and many scenarios and In Every Scenario. It contains a sequence of steps. That is likewise Feature keyword used for showing the functionality of the test.
Create Document amazon search. Feature under features/ directory and add few lines.
Feature: Amazon Search functionality
Scenario: searching for mobile phones on Amazon
Given a user goes to Amazon home page
When a user searches for "mobile phones."
Then amazon should return the result for "mobile phones."
These are the best-known facts about Howdy Web Automation with Ruby Cucumber and Waitr.
To get in-depth knowledge on Ruby Cucumber, you can enroll for live Ruby Cucumber online course by OnlineITGuru with 24/7 support and lifetime access
This is a good site for me to post my site here...
ReplyDeleteI love the way you post
Poker Online Indonesia
Poker IDN Terpercaya
IDN Poker Indonesia
Thanks to let me comment on your blog, this is make me happy :)
ReplyDeleteBandar Ceme
Agen IDN Poker
IDN Poker
I want to share my link here, and you will make money so easy :)
ReplyDeleteAgen Poker Resmi
Daftar IDN Poker
Daftar Poker IDN
Ruby cucumber automation have been shared perfectly.
ReplyDeleteManual Testing Training in Chennai
QTP Training in Chennai
Selenium Training in Chennai
SoapUI Training in Chennai
Software Testing Training in Chennai
Thank you so much for sharing this pretty post
ReplyDeletemicrostrategy courses | microstrategy training
Its very informative blog and useful article thank you for sharing with us , keep posting learn
ReplyDeletemicrostrategy online training | microstrategy training online
Thanks for sharing such a wonderful information from this post. We are also providing the best services click on below links to visit our website.
ReplyDeleteOracle Fusion HCM Training
Workday Training
Okta Training
Palo Alto Training
Adobe Analytics Training