Search Tutorials


Cucumber Testing Multiple-Choice Questions (MCQs) | JavaInUse

Cucumber Testing Multiple-Choice Questions (MCQs)

Q. What is Cucumber?

A testing framework for behavior-driven development (BDD)
A database management system
A programming language
A version control system

Q. Which language is used to write Cucumber scenarios?

Java
Python
Gherkin
Ruby

Q. What is a Feature file in Cucumber?

A file containing step definitions
A file containing test scenarios written in Gherkin
A configuration file for Cucumber
A file containing test results

Q. What is the purpose of Step Definitions in Cucumber?

To write test scenarios
To configure Cucumber
To map Gherkin steps to code
To generate test reports

Q. Which keyword is used to start a Cucumber scenario?

Given
When
Then
Scenario

Q. What does the "Given" keyword represent in a Cucumber scenario?

The precondition or initial context
The action performed by the user
The expected outcome
The end of the scenario

Q. What is a Scenario Outline in Cucumber?

A summary of all scenarios
A template for multiple scenarios with different data
An outline of the entire feature
A description of test steps

Q. Which keyword is used to provide example data for a Scenario Outline?

Data
Examples
Inputs
Values

Q. What is the purpose of tags in Cucumber?

To add comments to scenarios
To group and organize scenarios
To define step definitions
To create test data

Q. What is a Background in Cucumber?

A description of the feature
A set of steps that run before each scenario in a feature
A way to provide context to step definitions
A method to define global variables

Q. Which command is used to run Cucumber tests from the command line?

cucumber run
cucumber test
cucumber
run cucumber

Q. What is the purpose of the "And" keyword in Cucumber scenarios?

To combine multiple features
To add additional conditions to a step
To create loops in scenarios
To define variables





Q. What is a Hook in Cucumber?

A way to skip scenarios
A method to define global variables
A block of code that runs before or after scenarios
A tool for debugging scenarios

Q. Which of the following is NOT a valid Gherkin keyword?

Feature
Scenario
Given
Execute

Q. What is the purpose of the "But" keyword in Cucumber scenarios?

To negate a previous step
To create conditional scenarios
To add exceptions or contrasts
To end a scenario

Q. What is a Step Definition in Cucumber?

A Gherkin step in a scenario
A method that implements a step in a scenario
A type of assertion in Cucumber
A way to define variables in Cucumber

Q. What is the purpose of the "@" symbol in Cucumber?

To define variables
To create comments
To specify tags
To indicate optional steps

Q. What is a Data Table in Cucumber?

A way to store test data externally
A tabular data structure passed to step definitions
A type of assertion for comparing data
A method to generate random test data

Q. Which of the following is true about Cucumber reports?

They can only be generated in HTML format
They are automatically sent by email after each test run
They can be generated in various formats including HTML and JSON
They only show passed scenarios

Q. What is the purpose of the "Doc Strings" feature in Cucumber?

To add comments to scenarios
To include large amounts of text in a step
To define documentation for step definitions
To create multi-line assertions

Q. What is a Cucumber Expression?

A way to write complex assertions
A simplified version of regular expressions for matching step definitions
A method to combine multiple scenarios
A type of Gherkin syntax

Q. What is the purpose of the "Before" hook in Cucumber?

To define preconditions for scenarios
To run code before each scenario
To set up test data
All of the above

Q. Which command is used to generate step definitions for undefined steps in Cucumber?

cucumber --generate
cucumber --undefined
cucumber --dry-run
cucumber --steps

Q. What is the purpose of the "World" object in Cucumber?

To store global variables
To define the testing environment
To share state between steps
To create test data

Q. What is a Transformer in Cucumber?

A tool to convert feature files to step definitions
A method to change the execution order of scenarios
A function to convert step definition parameters
A way to modify Gherkin syntax

Q. What is the purpose of the "After" hook in Cucumber?

To define postconditions for scenarios
To run code after each scenario
To clean up test data
All of the above

Q. What is a Step Argument in Cucumber?

A variable passed to a step definition
A way to create reusable steps
A type of assertion
A method to skip steps

Q. What is the purpose of the "Rule" keyword in Cucumber?

To define test rules
To group related scenarios
To create conditional tests
To specify test priorities

Q. What is a Tagged Hook in Cucumber?

A hook that only runs for scenarios with specific tags
A way to tag step definitions
A method to create custom tags
A tool for organizing hooks

Q. What is the purpose of the "* " (asterisk) in Gherkin syntax?

To indicate an optional step
To create a wildcard step
To define a step that can be either Given, When, or Then
To comment out a step

Q. What is a Cucumber Profile?

A set of default configurations for running Cucumber tests
A way to create user profiles for testing
A tool for profiling test performance
A method to define custom step definitions

Q. What is the purpose of the @wip tag in Cucumber?

To mark a feature as high priority
To indicate a work in progress
To specify a Windows IP address
To create a web interface for the test

Q. What is a Custom Formatter in Cucumber?

A tool to format Gherkin syntax
A way to create custom step definitions
A method to generate custom test reports
A feature to format test data

Q. What is the purpose of the "Pending" status in Cucumber?

To indicate a passing test
To mark a test as blocked
To show that a step definition is not yet implemented
To highlight a high priority test