Blog

Top 20 Cucumber Interview Questions for SDET

Top 20 Cucumber Interview Questions for SDET

Share:

1. What is Cucumber?

Cucumber is a tool used to run the functional tests which are based on Behavior Driven Development(BDD) methodology. The test cases are written in a plain English text. Cucumber is written in Ruby programming language.

2. What are the advantages of Cucumber?

The various advantages of Cucumber are as follows:

  • Tests are written in plain English text which allows the less technical people to write scenarios as well.
  • Product owners, business analysts, developers, and testers all are involved in writing test scenarios.
  • Code Reusability.

3. What is the language used by Cucumber?

Gherkin language is used in Cucumber tool.

It is a representation of the application behavior in simple English language.

4. What are the two files required to run a cucumber test?

The 2 files required to run a cucumber test are:

  • Feature file
  • Step Definition File

5. What is a Feature File?

A Feature file contains a high-level description of acceptance tests.
It is an entry point of Cucumber execution.
It contains either a scenario or multiple scenarios.
The tests in Feature file are written in Given-When-Then statements.

6. What is the file extension of feature file?

The extension of the feature file is .feature.
For eg: Test.feature

7. What does feature file consists of?

Feature file consists of parameters or conditions that are required to execute the code, they are:

  • Feature
  • Scenario
  • Scenario Outline
  • Given
  • When Then

8. What is Step-definition in Cucumber?

Step-definition in Cucumber defines the actual code implementation of the feature present in feature file.
Each step of the feature file is mapped to a corresponding method on Step definition file.

9. What is Scenario Outline in Feature file?

Scenario Outline is used when the same test scenario is executed for multiple sets of data.
It is always followed by the keyword “Examples” and this keyword specifies the set of values for each parameter.

10. Explain different parameters of the feature file in Cucumber.

Feature: It describes the current test scripts that must be executed.

Scenario: It describes the steps and expected outcomes for a particular functionality.

Scenario Outline: It is used to execute same test scenario for multiple set of data.

Given: It specifies some context of the test to be executed.

When: It specifies some test action that needs to be carried out.

Then: It specifies the expected result of the test.

And: It is used for additional conditions, if any.

11. What are the advantages of Cucumber framework?

Advantages of Cucumber framework are as follows:

  • It is an open-source tool.
  • It is written in plain English text, hence making it easier for non-technical users to understand.
  • It is easy to integrate it with other frameworks like Selenium.
  • The test cases are easier to understand and maintain as well.

12. What is Background keyword in Cucumber?

Background keyword is used to define a test case or series of steps which are common to all the tests in a feature file. Scenario keyword is replaced by Background keyword while writing the Cucumber test case in feature file.

13. What is the limit for the maximum number of scenarios that can be included in the feature file?

A feature file can have maximum of 10 scenarios, but this number can vary for different projects and different organization. However, it is advisable to limit the number of scenarios in feature file.

14. What is the use of Examples keyword in Cucumber?

Examples keyword is always used with Scenario Outline.
It is used to provide the value of the parameters used in the scenario.

15. Give an example of a feature file using Cucumber framework.

Below is an example of a feature file for scenario: “Login the web application”

Feature: Login into the web application with username and password

Scenario: Login the web application

Given: Open Chrome browser and enter the URL

When: UserName and Password is provided

Then: Validate if login is successful

16. Give an example of Step definition.

Below is the example of Step definition for Given statement :

@Given(Open Chrome browser and enter the URL.)

public void OpenChromeBrowser()

{

   Driver = new ChromeDriver();

   Driver.navigate.To(“https://devlabsalliance.com/”); }

17. What symbol is used for parametrization in Cucumber?

Pipe (|) is used for parametrization in Cucumber.
It allows to specify one or more parameter values in a feature file.

18. Cucumber is supported in which programming language?

Cucumber provides support for various programming language like Java, .Net, Ruby, etc.

19. What is dryRun option in Cucumber?

dryRun is used to verify that every step in the feature file have corresponding code in Step Definition or not.

So, in case if any function gets missed in the Step definition for any step of feature file, then dryRun will give a message.

Its value can be set either true or false.

20. What is monochrome option in Cucumber?

Monochrome option makes the console output for Cucumber test much more readable.

Its value can be wither true or false.

If it is set to false, then the console output is not as readable as it should be.

More SDET Interview Question by Devlabs Alliance

  1. TOP 20 C# PROGRAMMING INTERVIEW QUESTIONS FOR SDET
  2. TOP 20 JUNIT INTERVIEW QUESTIONS FOR SDET
  3. TOP 50 SELENIUM INTERVIEW QUESTIONS FOR SDET
  4. TOP 50 GIT INTERVIEW QUESTIONS FOR SDET
  5. TOP 20 TESTNG INTERVIEW QUESTIONS FOR SDET
  6. TOP 20 JAVA PROGRAMMING INTERVIEW QUESTIONS FOR SDET
  7. TOP 20 BASIC JAVA INTERVIEW QUESTIONS FOR SDET
  8. TOP 20 SOFTWARE TESTING INTERVIEW QUESTIONS FOR SDET

Related Articles
Categories
Latest Articles

Popular Courses

Google Reviews
  • review rating 4  Both trainers (Ravi and Naresh) were excellent in their approach. Session was less of a theory and more of a practical. And even the theory part was quite interesting. A bit issue with the volume of information which I had received in just a span of 2-3 days - it seemed a bit over-loaded. But overall, it has given me a great platform to take it forward from here!

    thumb Varenya Varshney
    6/02/2019
  • review rating 4  Training provided by the trainers in DevLabs Alliance is completely awesome. Trainers are highly qualified in their areas with practical experience. Since it is 3 days training we have completely got the opportunity to have hands on.

    thumb Salaja K
    6/30/2019
  • review rating 5  Excellent Training program. Training courses and trainers are very good. Trainer will explain you as many time you ask the question. Best thing is hands on based training. You learn by doing. Looking for more courses from here.

    thumb Vijay Kumar
    6/30/2019
  • review rating 4  It was good session, I left my training room with basic knowledge on all the tools. Tutors have great knowledge and experience on the tools. But three days is not enough time.

    thumb sairam shyamala
    6/30/2019
  • review rating 5  Training provided by the trainers here is completely awesome. Trainer is highly qualified in their areas with practical experience. Also amenities provided during training by institute is great

    thumb Abhishek Tripathi
    6/02/2019
$('.enrollbtn').on('click', function (){ $( "#announcement" ).tabs( "option", "active", 0 ); $(' a[href="#announcement"]').trigger('click'); });