What is the use of Steps in Cucumber tool

0 votes
What is the use of Steps in Cucumber tool?
Aug 27, 2019 in Selenium by Darshan
842 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 27, 2018 in Selenium by Trisha
1,089 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
2,853 views
0 votes
1 answer

What is the use of Sibling in Xpath?

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

answered Jan 10, 2019 in Selenium by Frankie
• 9,830 points
1,891 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,140 points
10,145 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,500 points
13,735 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,190 points
9,172 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,910 points
7,249 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 3, 2020 in Selenium by Sri
• 3,190 points
7,887 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
1,013 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP