Last Updated On
Are you familiar with Cucumber and want to test your understanding? This post contains 25 useful Cucumber multiple-choice questions (quiz) to self-test your knowledge of Cucumber.
1. Cucumber is based on which framework?
Select the best answer
- TDD (Test driven development)
- BDD (Behaviour driven development)
- MVC (Model view controller)
- None
2. What is/are the advantage(s) of the Cucumber Tool?
Choose one option
- Cucumber Testing focuses primarily on the end-user experience since the end-user experience ultimately determines the success of software.
- There is no difficulty in writing test cases.
- In contrast to other tools, it provides a framework for testing an entire application.
- All of the above
3. Which of the below languages is used in Cucumber to describe the scenarios, behavior, and expected result of a feature?
Choose one option
- Python
- Ruby
- Gherkin
- Java
4. A feature file in cucumber is used to __
Choose one option
- Describe the scenarios, behaviour, and expected result of a feature.
- Create the test code in StepDefinition.
- Both (1) and (2)
- None of the above
5. Which of the following is true for a TestRunner class in cucumber?
Choose one option
- It is a Java file that defines or implements the logic for the scenario defined in the feature file.
- It is an interface between a feature file and a step definition file, and it is used to execute the step definition file corresponding to a feature file.
- Describe the scenarios, behaviour, and expected result of a feature.
- None
6. Which of the following is true for the Step Definition in cucumber?
- It is a Java method with an expression that links it to one or more Gherkin steps. When Cucumber executes a Gherkin statement in a scenario, it will look for a matching step definition to execute.
- It is a Java file that is used to trigger the TestRunner class.
- Describe the scenarios, behaviour, and expected result of a feature.
- None
7. Files with the extension __ are feature files.
- .f
- .fea
- .feat
- .feature
8. Select all the valid Gherkin keywords that can be used in a feature file to define the application behaviour:
- Background
- void
- super
- Scenario Outline
- Feature
- Given
- this
- When
9. There is a __ keyword at the beginning of every Cucumber testing feature file.
Choose one option
- Feature
- Scenario
- Then
- When
10. The preconditions of a test are described by the __ keyword.
Choose one option
- Given
- When
- Then
- Feature
11. A user’s actions are normally executed when they are defined as ___.
Choose one option
- Then
- When
- For
- Given
12. A keyword called ‘___’ pertains to what happens after a previous step or action
Choose one option
- Then
- When
- Given
- But
13. Negative conditions are added with the ‘___’ keyword.
Choose one option
- Background
- But
- And
- Or
14. When you add conditions to your steps, you use the ‘___’ keyword.
Choose one option
- And
- But
- Background
- For
15. Tests in a feature file use the ‘___’ keyword to define common steps.
Choose one option
- Back
- Ground
- Background
- For
16. What is a scenario outline in Cucumber?
Choose one option
- A way to run the same scenario with different inputs
- A way to run multiple scenarios in parallel
- A way to define the requirements for a particular feature
- A way to define the test results for a particular feature
17. What is a hook in Cucumber?
Choose one option
- A piece of code that runs before or after a scenario or feature
- A file that contains the test scenarios for a particular feature
- A file that contains the requirements for a particular feature
- A file that contains the test results for a particular feature
18. What is a tag in Cucumber?
Choose one option
- A label that can be applied to a scenario or feature
- A way to run multiple scenarios in parallel
- A way to define the requirements for a particular feature
- A way to define the test results for a particular feature
19. What is the purpose of the Given-When-Then syntax in Gherkin?
- To describe the setup, action, and expected result of a scenario
- To define the requirements for a particular feature
- To define the test results for a particular feature
- To run the same scenario with different inputs
20. Which of the following is an example of a Cucumber plugin?
Choose one option
- Cucumber Reports
- JUnit
- Selenium
- TestNG
21. Which of the following is an example of a Cucumber tag expression?
Choose one option
- @smoke
- @smoke or @regression
- @smoke and @regression
- All of the above
22. Tags are declared using the __ symbol
Choose one option
- @
- #
- $
- &
23. Operators can be used to test multiple tags:
Choose one option
- OR operator
- AND operator
- Both 1 and 2
- None of the above
24. In order to skip the test, a special symbol __ can be used within the tag.
Choose one option
- ~
- /
- \
- !
25. Which of the following keywords is NOT used while writing the Cucumber scenario?
Choose all options
- Given
- If
- But
- Then
====================================================================
Answers
1) 2) BDD (Behaviour driven development)
2) 4) All of the above
3) 3) Gherkin
4) 1) Describe the scenarios, behaviour, and expected result of a feature.
5) 2) It is an interface between a feature file and a step definition file, and it is used to execute the step definition file corresponding to a feature file.
6) 1) It is a Java method with an expression that links it to one or more Gherkin steps. When Cucumber executes a Gherkin statement in a scenario, it will look for a matching step definition to execute.
7) 4) .feature
8) 1) Background 4) Scenario Outline 5) Feature 6) Given 8) When
9) 1) Feature
10) 1) Given
11) 2) When
12) 1) Then
13) 2) But
14) 1) And
15) 3) Background
16) 1) A way to run the same scenario with different inputs
17) 1) A piece of code that runs before or after a scenario or feature
18) 1) A label that can be applied to a scenario or feature
19) 1) To describe the setup, action, and expected result of a scenario
20) 1) Cucumber Reports
21) 4) All of the above
22) 1) @
23) 3) Both 1 and 2
24) 1) ~
25) 2) If