Skip to content

Enozom

Top 10 Cucumber Interview Questions 2019

This article provides you with the necessary top 10 cucumber interview questions for the year 2019 so you can prepare yourself in the perfect way possible, these are the question you have to be prepared for in a Cucumber Interview.

What is Cucumber and what are the advantages of Cucumber?

To run functional tests written in a plain text Cucumber tool is used. It is written in a Ruby programming language. Advantages of Cucumber

  • You can involve business stakeholders who cannot code.
  • End user experience is priority.
  • High code reuse.

What are the 2 files required to execute a Cucumber test scenario?

The 2 files required to execute a Cucumber test scenario are

  • Features
  • Step Definition.

What is feature file in Cucumber? What does feature file consist of ?

Feature file in cucumber consist of parameters or conditions required for executing code, they are:

a) Feature.
b) Scenario.
c) Scenario Outline.
d) Given.
f) When.
g) Then.

What is step definition in Cucumber?

A step definition is the actual code implementation of the feature mentioned in feature file.

Explain what is BDD (Behaviour Driven Development)?

BDD or Behaviour driven development is a process of developing software based on TDD (Test Driven Development) which focusses on behavioural specification of software units.

What are before, after, beforeStep and afterStep hooks?

  • Before: executes before the feature file execution.
  • After: executes after the feature file execution.
  • BeforeStep: executes before each step execution.
  • AfterStep: executes after each step execution.

What are cucumber tags? And why do we use them?

Cucumber tags help in filtering the scenarios. We can tag the scenarios and then run them based on tags.

1- We can add tags to scenarios with <@> symbol.

Explain what is test harness?

A test harness for cucumber and rspec allows for separating responsibility between setting up the context and interacting with the browser and cleaning up the step definition files.

Explain what is Scenario Outline in feature file?

Scenario Outline: Same scenario can be executed for multiple sets of data using scenario outline. The data is provided by a tabular structure separated by (I I).

What is the purpose of cucumber dry-run?

We use to compile the cucumber feature files and step definitions. If there occur any compilation errors, then it shows them on the console.