Cucumber Interview Questions | Gherkin Language Questions
- What are feature files and step definitions? What is the purpose?
- What is runner class and why do we need it?
- How do you define feature file in runner class to execute and it’s required parameters?
- What are the different annotations in the feature file?
- How to integrate more than one feature file?
- Glue code implementation and scenarios?
- Data table implementation?
- What is the different annotation we can use in the test runner class?
- What is the difference between hooks and background?
- What is Tag and how to use it?
- What is value in cucumber
- How can we re-use data in multiple steps in the same scenario?
- The execution order of Hooks?
Cucumber Interview Questions Subjective
What is a cucumber?
A cucumber is a tool based on Behavior Driven Development (BDD) framework which is used to write acceptance tests for the web application. It allows the automation of functional validation in an easily readable and understandable format to Business Analysts, Developers, Testers, etc. The language that Cucumber understands is called Gherkin. It is written in a Ruby programming language.
What are the advantages of a Cucumber?
Advantages of Cucumber:
- You can involve business stakeholders who can not code.
- End-user experience is the priority.
- High code reuse.
Explain What Is BDD (Behavior Driven Development)?
BDD or Behaviour-driven development is a process of developing software based on TDD (Test Driven Development) which focuses on the behavioral specification of software units.
What is the profile in cucumber?
We can create profiles to run specific features and step definitions. We can use the following command to execute a cucumber profile.
Syntax: cucumber features -p Ex: cucumber features -p regression
What is the cucumber.yml file?
In the cucumber.yml file, we will create profiles.
What Is Support, Env.rb, And Hooks.rb?
Support is a folder where we can setup cucumber related support.
Env.rb file will be used to load the required libraries for scenario execution
hooks.rb we will add hooks like before, after, beforeStep and afterStep hooks.
Explain feature in Cucumber?
A feature can be defined as a standalone unit or functionality of a project. Let’s take a very common example of a social networking site.
How does the feature of this product/project look like?
Few basic features can be determined as –
- Create and remove the user from the social networking site.
- User login functionality for the social networking site.
- Sharing photos or videos on the social networking site.
- Sending a friend request.
- Logout.
Please Improve this article, if you find anything incorrect by commenting on the comment box and we are happy to work on the article to maintain the accuracy and improvement.
Leave a Reply