Pertanyaan dan Jawaban Wawancara Paling Populer & Tes Online
Platform edukasi untuk persiapan wawancara, tes online, tutorial, dan latihan langsung

Bangun keterampilan dengan jalur belajar terfokus, tes simulasi, dan konten siap wawancara.

WithoutBook menghadirkan pertanyaan wawancara per subjek, tes latihan online, tutorial, dan panduan perbandingan dalam satu ruang belajar yang responsif.

Prepare Interview

Ujian Simulasi

Jadikan Beranda

Bookmark halaman ini

Langganan Alamat Email
Beranda / Subjek Wawancara / Cucumber
WithoutBook LIVE Mock Interviews Cucumber Related interview subjects: 13

Interview Questions and Answers

Know the top Cucumber interview questions and answers for freshers and experienced candidates to prepare for job interviews.

Total 30 questions Interview Questions and Answers

The Best LIVE Mock Interview - You should go through before interview

Know the top Cucumber interview questions and answers for freshers and experienced candidates to prepare for job interviews.

Interview Questions and Answers

Search a question to view the answer.

Freshers / Beginner level questions & answers

Ques 1

What is Cucumber?

Cucumber is a tool that supports behavior-driven development (BDD) by allowing tests to be written in a natural language style.

Example:

Feature: Login
  Scenario: Successful login
    Given the user is on the login page
    When the user enters valid credentials
    Then the user should be logged in
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 2

What is the purpose of the Background keyword in Cucumber?

Background is used to define a set of steps that are common to all scenarios in a feature, helping to reduce duplication of steps.

Example:

Feature: Shopping Cart
  Background:
    Given a user is logged in
  Scenario: Add item to cart
    When the user adds an item to the cart
    Then the cart should display the item
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 3

What is the purpose of Tags in Cucumber?

Tags are used to categorize and filter scenarios, allowing selective execution of specific groups of scenarios.

Example:

@smoke
Feature: User Authentication
  Scenario: Successful login
    Given the user is on the login page
    When the user enters valid credentials
    Then the user should be logged in
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 4

How can you skip a scenario in Cucumber?

Scenarios can be skipped by tagging them with the @ignore tag or a tag that is not included in the test execution command.

Example:

@ignore
Scenario: This scenario will be skipped
    Given a precondition
    When an action is performed
    Then the result is validated
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 5

What is the purpose of the 'Background' keyword in Cucumber?

Background is used to define a set of steps that are common to all scenarios in a feature, helping to reduce duplication of steps.

Example:

Feature: Product Management
  Background:
    Given a user is logged in
  Scenario: Add a new product
    When the user adds a new product
    Then the product should be added successfully
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 7

What is the purpose of the 'But' keyword in Cucumber?

The 'But' keyword is used to provide an alternative step with additional clarification, often used after 'Given', 'When', or 'Then' for better readability.

Example:

Scenario: Login with valid credentials
    Given the user is on the login page
    When the user enters valid credentials
    Then the user should be logged in
    But the user dashboard should be displayed
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 8

How do you organize feature files in a Cucumber project?

Feature files are typically organized based on the functionality they represent or by feature. A common approach is to create directories for each feature and place related feature files within those directories.

Example:

project
|-- src
|   |-- test
|       |-- java
|           |-- features
|               |-- login
|                   |-- login.feature
|               |-- search
|                   |-- search.feature
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 9

What is the purpose of the 'Dry Run' option in Cucumber?

The 'Dry Run' option is used to check if all the steps in the feature file have matching step definitions. It helps identify undefined or pending steps without executing the actual test.

Example:

cucumber --dry-run
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments

Intermediate / 1 to 5 years experienced level questions & answers

Ques 10

Explain the difference between Cucumber Scenario Outline and Examples keywords.

Apakah ini membantu?
Add Comment View Comments
Ques 11

How do you parameterize steps in Cucumber?

Steps can be parameterized using angle brackets in the step definition, and values are passed through Examples in the Scenario Outline.

Example:

Scenario Outline: Search with different keywords
    Given the user is on the search page
    When the user searches for 
    Then results should include 
    Examples:
      | keyword   | result           |
      | cucumber  | relevant results |
      | testing   | accurate results |
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 12

Explain the concept of Step Definition in Cucumber.

Step Definitions are the actual code that maps the Gherkin language statements to executable code, providing the automation logic for each step.

Example:

Given(/^the user is on the login page$/, () => {
  // code to navigate to the login page
});
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 13

How do you handle dynamic data in Cucumber?

Dynamic data can be handled using scenario outline and examples, allowing the same scenario to be executed with different sets of data.

Example:

Scenario Outline: Search with dynamic data
    Given the user is on the search page
    When the user searches for 
    Then results should include 
    Examples:
      | dynamic_keyword | result           |
      | cucumber       | relevant results |
      | testing         | accurate results |
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 14

Explain the role of Hooks in Cucumber.

Hooks are blocks of code that run before or after specific events in the Cucumber execution cycle, such as before and after scenarios, features, or steps.

Example:

Before(() => {
  // code to run before each scenario
});
After(() => {
  // code to run after each scenario
});
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 15

What is the purpose of the 'Outline' keyword in Cucumber?

Apakah ini membantu?
Add Comment View Comments
Ques 16

What is the purpose of the 'DataTable' in Cucumber?

DataTable is used to represent tabular data in Gherkin syntax, providing an easy way to pass data to steps in a scenario.

Example:

Scenario: Data-driven login
    Given the user is on the login page
    When the user enters the following credentials
      | Username | Password |
      | user1    | pass123  |
    Then the user should be logged in
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 17

Explain the difference between 'Background' and 'Scenario Outline' in Cucumber.

Background is used to define a set of common steps for all scenarios in a feature, while Scenario Outline is used to run the same scenario with different sets of data.

Example:

Feature: Online Shopping
  Background:
    Given a user is logged in
  Scenario Outline: Add item to cart
    When the user adds  to the cart
    Then the cart should display the 
    Examples:
      | item     |
      | Laptop   |
      | Headphones|
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 18

What is the purpose of the 'DocString' in Cucumber?

DocString is used to pass a large string as an argument to a step, providing a way to include multiline data in a step definition.

Example:

Scenario: Add product description
    Given the user is on the product page
    When the user adds the following description
      """
      This is a detailed description of the product.
      It includes features and specifications.
      """
    Then the description should be saved
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 19

How can you parameterize a URL in Cucumber?

You can use scenario outline and examples to parameterize a URL and run the same scenario with different URLs.

Example:

Scenario Outline: Access different URLs
    Given the user navigates to 
    Then the page should load successfully
    Examples:
      | url                  |
      | https://example.com |
      | https://test.com    |
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 20

Explain the difference between Background and Hooks in Cucumber.

Background is used to define a set of common steps for all scenarios in a feature, while Hooks are blocks of code that run before or after specific events in the Cucumber execution cycle.

Example:

Feature: Online Shopping
  Background:
    Given a user is logged in
  Scenario: Add item to cart
    When the user adds an item to the cart
    Then the cart should display the item
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 21

How can you reuse step definitions in Cucumber?

Step definitions can be reused by creating separate step definition files and then referencing those step definitions in the feature files using the 'glue' option in the test runner configuration.

Example:

glue = {"path.to.step.definitions"}
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 22

What is the purpose of the 'Scenario Outline' Examples table header in Cucumber?

The Examples table header in Scenario Outline specifies the names of the variables that will be used in the scenario, and it helps map the values from the Examples table to the corresponding placeholders in the scenario steps.

Example:

Scenario Outline: Search with different keywords
    Given the user is on the search page
    When the user searches for 
    Then results should include 
    Examples:
      | keyword   | result           |
      | cucumber  | relevant results |
      | testing   | accurate results |
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 23

How can you handle dynamic data in Cucumber?

Dynamic data can be handled using Scenario Outline and Examples, allowing the same scenario to be executed with different sets of data.

Example:

Scenario Outline: Search with dynamic data
    Given the user is on the search page
    When the user searches for 
    Then results should include 
    Examples:
      | dynamic_keyword | result           |
      | cucumber       | relevant results |
      | testing         | accurate results |
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 24

Explain the difference between Cucumber and JUnit/TestNG.

Cucumber is a BDD tool that allows tests to be written in a natural language style, whereas JUnit and TestNG are testing frameworks used for unit testing in a more traditional manner.

Example:

Feature: Login
  Scenario: Successful login
    Given the user is on the login page
    When the user enters valid credentials
    Then the user should be logged in
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments

Experienced / Expert level questions & answers

Ques 25

What is the purpose of the 'Scenario Context' in Cucumber?

Scenario Context is used to share data between steps within the same scenario, allowing you to pass information between steps.

Example:

Scenario: Sharing data between steps
    Given a variable is initialized
    When the variable is modified
    Then the modified value should be accessible in subsequent steps
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 26

How do you handle asynchronous operations in Cucumber?

Asynchronous operations can be handled using explicit waits or tools like 'cucumber-waitfor'.

Example:

Scenario: Asynchronous operation
    Given the user initiates an asynchronous operation
    When the operation completes
    Then the result should be visible
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 27

Explain the purpose of the 'Scenario Context' in Cucumber.

Scenario Context is used to share data between steps within the same scenario, allowing you to pass information between steps.

Example:

Scenario: Sharing data between steps
    Given a variable is initialized
    When the variable is modified
    Then the modified value should be accessible in subsequent steps
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 28

How can you run Cucumber tests in parallel?

Cucumber tests can be run in parallel by using tools like TestNG or by configuring parallel execution in the test runner configuration.

Example:

mvn test -Dcucumber.options="--threads 2"
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 29

How do you handle browser-specific testing in Cucumber?

Browser-specific testing can be handled by using tags and configuring the test runner to run scenarios with specific tags. Different scenarios can be tagged for different browsers, and appropriate configuration can be set for each browser.

Example:

@chrome
Scenario: Test on Chrome browser
    Given the user is on the application
    When the user performs an action
    Then the result should be validated
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 30

What is the purpose of the 'Scenario Context' in Cucumber?

Scenario Context is used to share data between steps within the same scenario, allowing you to pass information between steps.

Example:

Scenario: Sharing data between steps
    Given a variable is initialized
    When the variable is modified
    Then the modified value should be accessible in subsequent steps
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments

Most helpful rated by users:

Hak Cipta © 2026, WithoutBook.