Cucumber Interview Questions

Cucumber Interview Questions

Cucumber is a software tool used by computer programmers for testing other software. It runs automated acceptance tests written in a behavior-driven development style. Central to the Cucumber BDD approach is its plain language parser called Gherkin.

1.Cucumber is open source?

Yes, Cucumber is an open source BDD framework.

2.What are the advantages of using cucumber?

It is written in Gherkin which is plain text , any one can understand the behaviour of application, code reusability,supports different languages like and Ruby,It bridges the gap between
1.Business Analyst and Developes
2.Manual Testers and Automation Testers
3.Manual Testers and Developers

3.Explain when to use Rspec and when to use Cucumber?

Rspec is used for Unit Testing Cucumber is used behaviour driven development. Cucumber can be used for System and Integration Tests.

4.Name the tools which supports BDD.

There are many tools which supports BDD , some of the famous tools are


5.Tell me what are the Gherkin syntax you know?

Gherkin Syntax are
9.Scenario Outline
11.Scenario Templates

6.Can we write cucumber tags ( @smoke , @Run etc ) above feature keywork  in   feature file?

Yes, we can write cucumber tags (@smoke , @Run etc ) above feature keywork in feature file.

7.What is the pattern of writing Given, When, Then, And, or But?

Below is the pattern
Given steps are used to describe the initial context of the system.
When steps are used to describe an event, or an action.
Then steps are used to describe an expected outcome, or result.
And,But steps are use to add more Given , When and Then steps

8.What is the significance of Background keyword in feature file?

The significance of Background keyword in feature file is that steps written in background repeats before each scenario in feature file.

9.What is the main difference between Scenario and Scenario outline?

The Scenario Outline keyword can be used to run the same Scenario multiple times, with different combinations of values.

10.Write an three line code to show scenario outline?

Scenario Outline: Walking
Given I have to walk kilometers.
When I walked kilometers.
Then I have to walk more kilometers

| total | current | remaining |
| 12    | 5           | 7                |
| 20    | 5           | 15              |

11.What is the extension of feature file?

The extesion of feature file is “.feature”

12.What are the cucumber assertions?

Cucumber does not come with an assertion library. Instead, use the assertion methods from a unit testing tool. Example :Junit or TestNG.

13.What are the cucumber tags?

Cucumber tags are used to filter the scenarios in feature files.

14.What Is Cucumber Dry Run?

Method overloading increase the readability of the program.

15.Is It Mandatory To Use The Keywords While Writing Scenario Steps ?

No, it is not mandatory to used keywords while writing scenario steps
without using keywords we can write as below
* I am on the landed page.

16.What are the hooks in Cucumber?

Cucumber hooks are the blocks of code that run before or after each scenario.
There are two types of hooks
1)@Before- Runs before each scenario
2.)@After -After hooks run after the last step of each scenario, even when steps are failed, undefined, pending or skipped.

17.Does cucumber supports steps hooks?

No, cucumber does not support steps hooks such as @BeforeStep and

18.What are the tagged hooks in cucumber?

Hooks can be conditionally selected for execution based on the tags of the scenario. To run a particular hook only for certain scenarios.

@Before(“@browser @smoke”)
public void doSomethingBefore() {

//Lines of code }

@After(“@browser @smoke”)

public void doSomethingAfter() {

//Lines of code

19.On what places you can write tags in feature file?

Tags can be placed above the following Gherkin elements:
3.Scenario Outline

20.What is Tag Inheritance in cucumber?

Tags are inherited by child elements.
1.Tags that are placed above a Feature will be inherited by Scenario, Scenario Outline, or Examples.
2.Tags that are placed above a Scenario Outline will be inherited by Examples.

Leave a Reply

Your email address will not be published. Required fields are marked *