Cucumber Interview Questions & Answers

  • Question 1. What Is Cucumber?

    Answer :

    Cucumber is a Behavior Driven Development (BDD) tool. Cucumber is a tool that executes plain-text functional descriptions as automated tests. The language that Cucumber understands is called Gherkin.

    In BDD, users (business analysts, product owners) first write scenarios or acceptance tests that describes the behavior of the system from the customer’s perspective, for review and sign-off by the product owners before developers write their codes.

  • Question 2. Cucumber Execution Starts From Where?

    Answer :

    Cucumber execution will starts from support. In support first it will load the env.rb file then it will load hooks.rb and then it will start execute feature file scenario steps.

  • SQL Server 2008 Interview Questions

  • Question 3. What Is Support, Env.rb And Hooks.rb ?

    Answer :

    • Support is a foder where we can setup cucumber related support.
    • Env.rb file will be used to load the required libraries for cucumber scenario execution
    • hooks.rb we will add hooks like before, after, beforeStep and afterStep hooks.
  • Question 4. What Is Profile In Cucumber?

    Answer :

    We can create Cucumber profiles to run specific features and step definitions

    We can use following command to execute a cucumber profile

    cucumber features -p

    Ex: cucumber features -p regression

  • SQL Server 2008 Tutorial

  • Question 5. What Are Before, After, Beforestep And Afterstep Hooks?

    Answer :

    Before: execute before the feature file execution

    After: executes after the feature file execution

    BeforeStep: executes before the each step execution

    AfterStep: executes after the each step execution

  • Agile Testing Interview Questions

  • Question 6. What Are Cucumber Tags? Why We Use The Tags?

    Answer :

    cucumber tags used to filter the scenarios. We can tag the scenarios and we can execute the scenarios based on tags, We can add tags to scenarios with @ We can use following command to execute a cucumber tagged scenarios.

    cucumber features -t @

    Ex: cucumber features -t @test

  • Question 7. What Is Cucumber Dry Run?

    Answer :

    Cucumber dry run is used to compile cucumber feature files and stepDefinitions. If there is any compilations errors it will show when we use dry run

    Ex: Cucumber features –dry-run

  • Agile Testing Tutorial Selenium Interview Questions

  • Question 8. What Is Scenario Outline?

    Answer :

    Scenario outline is used to execute the same scenario with different test data.

  • Question 9. Is It Mandatory To Use The Keywords While Writing Scenario Steps ?

    Answer :

    No it is not mandatory to used keywords while writing scenario steps.

    We can write the scenario steps like the following without using keywords

    * I am on the landed page

  • SSIS(SQL Server Integration Services) Interview Questions

  • Question 10. How To Generate Cucumber Execution Reports?

    Answer :

    We can use the following command to generate html reports.

    –format html –out report.html –format pretty.

  • Selenium Tutorial

  • Question 11. How To Run A Particular Scenario From A Feature File ?

    Answer :

    We can run particular scenario from a feature file by giving the scenario line number

    Ex: cucumber features/test.feature:21

  • SSRS(SQL Server Reporting Services) Interview Questions

  • Question 12. What Is Cucumber And What Are The Advantages Of Cucumber?

    Answer :

    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 inolve business stakeholders who can not code
    • End user experience is priority
    • High code reuse
  • SQL Server 2008 Interview Questions

  • Question 13. What Are The 2 Files Required To Execute A Cucumber Test Scenario?

    Answer :

    The 2 files required to execute a Cucumber test scenario are

    1. Features
    2. Step Definition
  • Java Tutorial

  • Question 14. What Is Feature File In Cucumber? What Does Feature File Consist Of ?

    Answer :

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

    1. Feature
    2. Scenario
    3. Scenario Outline
    4. Given
    5. When
    6. Then
  • Question 15. Give An Example Of Behaviour Driven Test In Plain Text?

    Answer :

    Feature: Visit XYZ page in

    Scenario : Visit

    Given: I am on

    When: I click on XYZ page

    Then: I should see ABC page

  • SQL Server Management Studio Interview Questions

  • Question 16. Explain What Is Scenario Outline In Feature File?

    Answer :

    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).

  • JUnit Tutorial

  • Question 17. What Is Step Definition In Cucumber?

    Answer :

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

  • Java Interview Questions

  • Question 18. Give The Example For Step Definition Using “given” Function?

    Answer :

    For example to make visitor visit the site “ap6am” the command we use for given:

    Given (/^ I am on$/) do

    Browser.goto “”

    end – This will visit

  • Agile Testing Interview Questions

  • Question 19. What Are The Difference Between Jbehave And Cucumber?

    Answer :

    • Although Cucumber and Jbehave are meant for the same purpose, acceptance tests are completely different frameworks
    • Jbehave is Java based and Cucumber is Ruby based
    • Jbehave are based on stories while Cucumber is based on features.
  • Cucumber Tutorial

  • Question 20. Explain What Is Test Harness?

    Answer :

    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.

  • Automation Testing Interview Questions

  • Question 21. Explain When To Use Rspec And When To Use Cucumber?

    Answer :

    1. Rspec is used for Unit Testing.
    2. Cucumber is used behaviour driven development. Cucumber can be used for System and Integration Tests.
  • Question 22. What Is The Language Used For Expressing Scenario In Feature File ?

    Answer :

    Gherkin language is used to express scenario in feature files and ruby files containing unobtrusive automation for the steps in scenarios.

  • Agile Methodology Tutorial

  • Question 23. Explain What Is Regular Expressions?

    Answer :

    A regular expression is a pattern describing a certain amount of text. The most basic regular expression consists of a single literal character.

  • JUnit Interview Questions

  • Question 24. Explain What Is Bdd (behaviour Driven Development) ?

    Answer :

    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.

  • Selenium Interview Questions

  • Question 25. What Softare Do You Need To Run A Cucumber Web Test?

    Answer :

    Ruby and its Development Kit
    IDE like ActiveState
    Watir ( To simulate browser)
    Ansicon and rspec (if required)

  • Question 26. What Does A Features/ Support File Contains?

    Answer :

    Features/ support file contains supporting ruby code. Files in support load before those in step_definitions, which can be useful for environment configuration.

  • Sql Server Dba Interview Questions

  • Question 27. What Is Bdd Framework.what Is The Benefit Of Bdd In Selenium ?

    Answer :

    BDD is becoming widely accepted practice in agile software development, and Cucumber-JVM is a mainstream tool used to implement this practice in Java. Cucumber-JVM is based on Cucumber framework, widely used in Ruby on Rails world as well as in Java and .Net.

    Cucumber-JVM allows developers, QA, and non-technical or business participants to write features and scenarios in a plain text file using Gherkin language with minimal restrictions about grammar in a typical Given, When, and Then structure.

    The feature file is then supported by a step definition file, which implements automated steps to execute the scenarios written in a feature file. Apart from testing APIs with Cucumber-JVM, we can also test UI level tests by combining Selenium WebDriver.

  • SSIS(SQL Server Integration Services) Interview Questions