What is the use of Steps in Cucumber tool

0 votes
What is the use of Steps in Cucumber tool?
Aug 26, 2019 in Selenium by Darshan
223 views

1 answer to this question.

0 votes

Hi Darshan, Steps are basically the Sequences which can be used to describe how exactly the test scenario will take place. It also defines the preconditions of the test scenario. Some of the Keywords used by Steps are:

  • And - logical representation of the Cucumber test

  • But - This is same as And but is negative form. 

The commands which are mainly used in Steps of Cucumber Execution are:
  • Given - Before starting the tests, all of its conditions is described by this. 

  • When - The actions during Cucumber tests are described by this.

  • Then - This is the outcome of the actions which took place When.  

For eg, following example shows a Cucumber Steps Definition file:
Step 1:

Given (/^ I am on google.com$/) do

Browser.goto "http://google.com" -This will visit career.guru99 on browser

end

Step 2:
When (/^ click on I'm Feeling Lucky$/) do

Browser.text (:name, "btnI" ).click – This will click "I'm Feeling Lucky button"

end
	
Step 3:

Then (/^ I should see google doodles page$/) do

Browser.goto "http://google.com/doodles/" - It will visit "doodles page"

end

answered Aug 27, 2019 by Anvi
• 14,150 points

Related Questions In Selenium

0 votes
1 answer

What is the use of grouping in testNG?

Grouping is the method used to separate ...READ MORE

answered Dec 26, 2018 in Selenium by Trisha
382 views
0 votes
1 answer

What is the use of @listener annotation in TestNG?

 @listeners are used to configure reports and ...READ MORE

answered Jan 2, 2019 in Selenium by Shuvodip
1,533 views
0 votes
1 answer

What is the use of Sibling in Xpath?

Using sibling keyword, we can fetch a ...READ MORE

answered Jan 9, 2019 in Selenium by Frankie
• 9,810 points
959 views
0 votes
1 answer

What is the use of getOptions() method in Selenium?

Hi Urmila, getOptions() is used to get all ...READ MORE

answered May 31, 2019 in Selenium by Abha
• 28,060 points
5,726 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,520 points
5,349 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,050 points
6,030 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,890 points
3,733 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 2, 2020 in Selenium by Sri
• 3,050 points
4,549 views
0 votes
1 answer

What is the use of AutoIt tool with Selenium?

Hey Badrish, AutoIT is a third party tool ...READ MORE

answered May 31, 2019 in Selenium by Anvi
• 14,150 points
374 views