What is the use of Steps in Cucumber tool?

0 votes
What is the use of Steps in Cucumber tool?
Aug 26 in Selenium by Darshan
54 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 by Anvi
• 12,860 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
74 views
0 votes
1 answer
0 votes
1 answer

What is the use of Sibling in Xpath?

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

answered Jan 9 in Selenium by Frankie
• 9,810 points
175 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 in Selenium by Abha
• 23,030 points
165 views
0 votes
1 answer

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,090 points
569 views
0 votes
1 answer
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,130 points
897 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
561 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 in Selenium by Anvi
• 12,860 points
49 views