Most Asked Cucumber BDD Interview Questions
Most Asked Cucumber BDD Interview Questions
1) What is Cucumber?
Cucumber is a tool that supports Behaviour-Driven-Development (BDD) which
is used to write acceptance tests for the web application. Cucumber can be used
along with Selenium. Cucumber supports many other languages like Perl, PHP,
Python, Net etc.
.
6) What does a feature file consist of?
Feature file consists of different test scenarios written using Gherkin language
in Given/When/And/Then format.
7) What are the various keywords that are used in Cucumber for writing a
scenario?
Most common keywords used in Cucumber are: Feature Background
Scenario Given When Then And But
13) What is the limit for the maximum number of scenarios that can be
included in the feature file?
You can have as many scenarios as you like, but it is recommended to keep the
number at 3-5. Having too many steps in an example, will cause it to lose its
expressive power as specification and documentation.
25) What is the language used for expressing scenario in feature file?
Cucumber uses the Gherkin language to define the scenario in feature file using
keywords like Given, Then, And, When, etc
34) What is the difference between Given, When, Then steps in feature file?
Given steps are used to describe the initial context of the system i.e., the scene
of the scenario.
When steps are used to describe an event, or an action.
Then steps are used to describe an expected outcome, or result.
40) What is the use of glue property under Cucumber Options tag?
The glue is a part of Cucumber options that describes the location and path of
the step definition file.
47) Name any two testing frameworks that can be integrated with
Cucumber?
TestNG and Junit can be easily integrated with Cucumber.
48) Name any two build management tools that can be integrated with
Cucumber?
Maven and Ant are two build management tools which can be integrated with
cucumber.
49) Name any advanced framework design that can be used with
Cucumber?
Page Object Model can be used with Cucumber.
51) Can you name any other BDD tools except Cucumber?
Behave, JBehave, and SpecFlow
52) Can we write cucumber tags ( @smoke , @Run etc ) above feature
keyword in feature file?
Yes. We can write these cucumber tags above the feature keyword.
65) What is the maximum number of steps that are to be written within a
scenario?
There is no fixed limit of steps within a scenario and it is completely dependent
on the application.
74) What is the main difference between Scenario and Scenario outline?
-Scenario can be executed only once but Scenario outline can be used to
execute scenario multiple times with different sets of data.
-
contain examples.