Cucumber Testing Multiple-Choice Questions (MCQs) _ JavaInUse
Cucumber Testing Multiple-Choice Questions (MCQs) _ JavaInUse
Q. What is Cucumber?
A testing framework for behavior-driven development (BDD)
A database management system
A programming language
A version control system
Check Answer
Correct answer. Cucumber is a testing framework that supports Behavior Driven Development
(BDD). It allows you to write test cases in plain language that can be understood by non-technical
stakeholders.
Check Answer
Correct answer. Cucumber scenarios are written in Gherkin language. Gherkin uses a set of
special keywords to give structure and meaning to executable specifications.
https://www.javainuse.com/quiz/cuc 3/19
4/22/25, 5:41 AM Cucumber Testing Multiple-Choice Questions (MCQs) | JavaInUse
Check Answer
Correct answer. A Feature file in Cucumber contains test scenarios written in Gherkin language. It
describes a single feature of the system using natural language statements.
Check Answer
Correct answer. Step Definitions in Cucumber are used to map the Gherkin steps to actual code
implementation. They define how each step in a scenario should be executed.
Check Answer
Correct answer. The keyword Scenario is used to start a Cucumber scenario. It is followed by a
brief description of the scenario.
https://www.javainuse.com/quiz/cuc 4/19
4/22/25, 5:41 AM Cucumber Testing Multiple-Choice Questions (MCQs) | JavaInUse
Check Answer
Correct answer. The Given keyword in a Cucumber scenario represents the precondition or initial
context. It sets up the state of the system before the user starts interacting with it.
Check Answer
Correct answer. A Scenario Outline in Cucumber is a template for multiple scenarios with different
data. It allows you to run the same scenario multiple times with different sets of input data.
Check Answer
Correct answer. The Examples keyword is used to provide example data for a Scenario Outline in
Cucumber. It is followed by a table of data that will be used to run the scenario multiple times.
https://www.javainuse.com/quiz/cuc 5/19
4/22/25, 5:41 AM Cucumber Testing Multiple-Choice Questions (MCQs) | JavaInUse
Check Answer
Correct answer. Tags in Cucumber are used to group and organize scenarios. They allow you to
selectively run certain scenarios, hook into specific scenarios for setup or teardown, and generate
reports based on tags.
Check Answer
Correct answer. A Background in Cucumber is a set of steps that run before each scenario in a
feature. Its used to avoid repetition of common steps across multiple scenarios within the same
feature.
Check Answer
Wrong! The correct answer is C. The command cucumber is used to run Cucumber tests from the
command line. You can also specify additional options and arguments with this command.
https://www.javainuse.com/quiz/cuc 6/19
4/22/25, 5:41 AM Cucumber Testing Multiple-Choice Questions (MCQs) | JavaInUse
Check Answer
Correct answer. The And keyword in Cucumber scenarios is used to add additional conditions or
actions to a step. It helps in making scenarios more readable by avoiding repetition of Given,
When, or Then.
Close X
https://www.javainuse.com/quiz/cuc 7/19
4/22/25, 5:41 AM Cucumber Testing Multiple-Choice Questions (MCQs) | JavaInUse
https://www.javainuse.com/quiz/cuc 8/19
4/22/25, 5:41 AM Cucumber Testing Multiple-Choice Questions (MCQs) | JavaInUse
Correct answer. A Hook in Cucumber is a block of code that runs before or after scenarios. Its
used for setup and teardown operations that are common across multiple scenarios or features.
Check Answer
Correct answer. Execute is not a valid Gherkin keyword. The main Gherkin keywords are Feature,
Scenario, Given, When, Then, And, But, Background, Scenario Outline, and Examples.
Check Answer
Wrong! The correct answer is C. The But keyword in Cucumber scenarios is used to add
exceptions or contrasts. Its similar to And but used when you want to note a contrast or
exception to the previous step.
https://www.javainuse.com/quiz/cuc 9/19
4/22/25, 5:41 AM Cucumber Testing Multiple-Choice Questions (MCQs) | JavaInUse
Correct answer. A Step Definition in Cucumber is a method that implements a step in a scenario.
It maps the Gherkin steps in feature files to actual code that performs the actions described in
the steps.
Check Answer
Correct answer. The @ symbol in Cucumber is used to specify tags. Tags are used to organize
and selectively run scenarios, as well as to apply hooks to specific scenarios or features.
Check Answer
Correct answer. A Data Table in Cucumber is a tabular data structure that can be passed to step
definitions. It allows you to specify more complex data directly in your Gherkin scenarios.
Check Answer
Close X
https://www.javainuse.com/quiz/cuc 10/19
4/22/25, 5:41 AM Cucumber Testing Multiple-Choice Questions (MCQs) | JavaInUse
Correct answer. Cucumber reports can be generated in various formats including HTML and
JSON. These reports provide detailed information about test execution, including passed, failed,
and skipped scenarios.
Check Answer
Correct answer. Doc Strings in Cucumber are used to include large amounts of text in a step.
They are useful when the step has a table of data or multiple lines of text that need to be passed
to the step definition.
Check Answer
Correct answer. Cucumber Expressions are a simplified version of regular expressions used for
matching step definitions. They provide a more readable and maintainable way to define step
patterns compared to traditional regular expressions.
Check Answer
https://www.javainuse.com/quiz/cuc 11/19
4/22/25, 5:41 AM Cucumber Testing Multiple-Choice Questions (MCQs) | JavaInUse
Correct answer. The Before hook in Cucumber serves multiple purposes: it can define
preconditions for scenarios, run code before each scenario, and set up test data. It's a powerful
tool for setting up the test environment.
Check Answer
Wrong! The correct answer is C. The command cucumber --dry-run is used to generate step
definitions for undefined steps in Cucumber. It runs through your features without actually
executing them and outputs the missing step definitions.
Check Answer
Wrong! The correct answer is C. The World object in Cucumber is used to share state between
steps. It provides a way to store and access data that needs to be available across different step
definitions within a scenario.
Check Answer
https://www.javainuse.com/quiz/cuc 12/19
4/22/25, 5:41 AM Cucumber Testing Multiple-Choice Questions (MCQs) | JavaInUse
Wrong! The correct answer is C. A Transformer in Cucumber is a function used to convert step
definition parameters. It allows you to automatically transform the string arguments passed to
step definitions into more complex types or objects.
Check Answer
Correct answer. The After hook in Cucumber serves multiple purposes: it can define
postconditions for scenarios, run code after each scenario, and clean up test data. It's commonly
used for teardown operations.
Check Answer
Correct answer. A Step Argument in Cucumber is a variable passed to a step definition. It allows
you to parameterize your steps, making them more flexible and reusable across different
scenarios.
Check Answer
https://www.javainuse.com/quiz/cuc 13/19
4/22/25, 5:41 AM Cucumber Testing Multiple-Choice Questions (MCQs) | JavaInUse
Wrong! The correct answer is B. The Rule keyword in Cucumber is used to group related
scenarios. It helps in organizing scenarios that belong to a particular business rule or feature
aspect, improving the readability and structure of feature files.
Check Answer
Correct answer. A Tagged Hook in Cucumber is a hook that only runs for scenarios with specific
tags. It allows you to apply certain setup or teardown operations only to scenarios that have
been tagged with particular labels.
Check Answer
Correct answer. The * (asterisk) in Gherkin syntax is used to define a step that can be either Given,
When, or Then. It's a shorthand that allows you to write steps without specifying their exact
nature, which can be useful in certain scenarios.
Check Answer
https://www.javainuse.com/quiz/cuc 14/19
4/22/25, 5:41 AM Cucumber Testing Multiple-Choice Questions (MCQs) | JavaInUse
Wrong! The correct answer is A. A Cucumber Profile is a set of default configurations for running
Cucumber tests. It allows you to define different sets of options for running your tests, which can
be easily switched between using command-line arguments.
Check Answer
Wrong! The correct answer is B. The @wip tag in Cucumber stands for work in progress. Its
commonly used to mark scenarios or features that are still being developed or are not yet ready
for full testing, allowing testers to easily exclude or focus on these items during test runs.
Check Answer
Check Answer
https://www.javainuse.com/quiz/cuc 15/19
4/22/25, 5:41 AM Cucumber Testing Multiple-Choice Questions (MCQs) | JavaInUse
Correct answer. The Pending status in Cucumber is used to show that a step definition is not yet
implemented. It's a way to indicate that a scenario has been defined but the corresponding step
definition code hasn't been written yet.
Popular Posts
Spring Boot Interview Questions (/spring/SpringBootInterviewQuestions)
Implement Spring Boot Security and understand Spring Security
Architecture (/webseries/spring-security-jwt/chap3)
E-commerce Website - Online Book Store using Angular 8 + Spring Boot
(/fullstack/ecommerce)
Spring Boot +JSON Web Token(JWT) Hello World Example (/spring/boot-
jwt)
Angular 7 + Spring Boot Application Hello World Example (/spring/ang7-
hello)
Build a Real Time Chat Application using Spring Boot + WebSocket +
RabbitMQ (/spring/boot-websocket-chat)
Pivotal Cloud Foundry Tutorial - Deploy Spring Boot Application Hello
World Example (/pcf/pcf-hello)
Deploying Spring Based WAR Application to Docker
(/devOps/docker/docker-war)
EIP patterns using Apache Camel (/camel/camel_EIP)
Spring Cloud- Netflix Eureka + Ribbon Simple Example
(/spring/spring_ribbon)
Spring Cloud- Netflix Hystrix Circuit Breaker Simple Example
(/spring/spring_hystrix_circuitbreaker) Close X
https://www.javainuse.com/quiz/cuc 16/19