Following are the some basic and advanced 20 Top Cucumber Interview Question and answer for both beginner and experience automation Tester. We have focused on BDD with practical scenario, Feature file, and some more on Regex etc.
Before going ahead, please have a look on BDD Tutorial to have some better understanding on the BDD basic.
1. What is Cucumber ?
Cucumber is a tool that is based on behavior driven development framework. The main purpose of cucumber is to make various project roles such as Business analyst, Quality Assurance, Developer etc. to understand the application without describing deep technical aspects. That means without technical background knowledge also you can understand the application behavior.

2. What programming language is used for cucumber BDD?
Different programming language like java, .net, ruby etc. supports cucumber to write Behavioral driven test case.
3. In which language cucumber is written?
Cucumber is written in Gherkin language. This is a simple English representation of the application behavior. Gherikin language uses several keywords to describe the behavior of the application such as Feature, Scenario, Scenario outline, Given, When, Then etc.
4. What are the advantages of the Cucumber Framework?
- Cucumber is Open source tool so that you can customize the source code to extend the basic functionality as per your requirement.
- It is a plain text representation so that it is easier for non-technical people to understand the functionality and scenario of the application.
- Cucumber bridges the communication gap between the various project stack holder like Business Analyst, Developer and QA.
- It is easier to maintain and understand as well.
- It is easy to integrate with Other tool such as selenium.
5. What is the Purpose of the BDD Methodology in the real time project?
BDD is nothing but a methodology in which you can write the application use cases in plain text format. That’s why we are using the BDD framework in real time projects.
6. What is the file Extension of the Feature file?
The file extension of the feature file is .feature. This is basically written in Notepad. After writing the feature file save file with extension .feature.
7. When cucumber used in real time?
Cucumber tools in real time helps to write user acceptance testing for an user . Non-technical user such as Business analyst, Functional Tester etc. are writing the test case easily without having technical knowledge.
9. What Plugin is used to integrate Eclipse with Cucumber?
Cucumber natural plugin is used to integrate Eclipse with Cucumber.
10. Why we used TestRunner Class in Cucumber?
We use TestRunner class to provide the link between feature file and step definition file.
11. What is the starting point of execution for feature file?
When we integrate cucumber with Selenium, then starting point of feature file must be TestRunner class
12. What is the use of features property under cucumber option tag?
To identify the location of the features file we use cucumber option tag.
13. Can we write any code within TestRunner class?
No.
14. What is the of background keyword in cucumber?
Background keyword group multiple given statement into a single group. We will use this when the same set of given statement with repeated in same scenario of feature file.
15. What is the purpose of the Step definition file in cucumber?
A step definition file in cucumber segregates the feature files. Each step of the feature file can map to corresponding method on the step definition file. While feature files are written is easily understandable language like Gherkin, Step definition files are written in programming language like java, .net.ruby etc.
16. What is the use of scenario outline in cucumber?
Scenario outline is the way of parameterization of scenarios. We can use this when the same scenario needs to be executed for multiple sets of data. However test step remains same. Scenario Outline must follow by the keyword .
17. Why do we use feature file?
Feature file must provide the high-level description of an application under test. First line of feature file must start with the keyword is Feature following the description of the application under test. Feature file may include multiple scenario ins same file. For any feature file you need to save the file with .feature extension.