Cucumber is an open-source test automation framework that is used to write test cases in natural language. It is based on the Gherkin language specification, which uses a simple grammar to express the steps of the test, the expected results, and other information.

Cucumber is a testing tool that supports Behavior Driven Development (BDD) and is written in Ruby. It offers a way of writing tests that everyone can understand, regardless of their technical knowledge. In BDD, users (business analysts, product owners) first write scenarios or acceptance tests that describe the behavior of the system from the customer’s perspective, and these are intended to be reviewed and signed off by product owners before developers write code. You can use Cucumber together with Watir, Selenium, Capybara etc. It supports many other languages such as PHP, Net, Python, Perl.

Advantages of Cucumber

  • IT Testers can write test scripts without having deep programming knowledge.
  • Plugins are faster compared to Selenium.
  • It supports various programming languages.
  • The code is reusable.
  • Easy and quick setup.
  • It can be used to automate testing on a variety of platforms, including web applications, desktop applications, and APIs.
  • Cucumber can be extended with custom steps and features.
  • It uses a natural language that is easy to understand for both testers and developers.

Disadvantages of Cucumber

  • Cucumber tests can be difficult to maintain if the application changes frequently.
  • Requires user involvement in order to properly describe scenarios.

Comparison of Cucumber with other frameworks

Cucumber is often compared to other test automation frameworks such as Selenium, TestNG, Cypress, Robot Framework and Jbehave.

Cucumber vs Selenium

  • Selenium is a testing automation framework, while Cucumber is a behavioral testing tool.
  • Selenium is written in programming languages such as Java, .net and others, while Cucumber is written in Ruby.
  • Selenium supports conditional statements, but Cucumber does not.
  • Test scripts in Selenium are written based on requirements, but in Cucumber you first start with scripts.
  • Selenium scripts are difficult to develop, while Cucumber scripts are easier.
  • Identifying syntax errors during script development in Selenium is relatively easy, whereas in Cucumber you won’t find errors right away.
  • Both frameworks support Perl, Python, Java, PHP, .net and other languages.
  • Installing Selenium is more difficult than installing Cucumber.
  • Selenium is used for functional and performance testing, Cucumber is used for testing user stories.
  • Selenium is focused on web applications, Cucumber can be used to test any type of software.

Cucumber vs TestNG

  • TestNG supports test-driven development (TDD), Cucumber supports behavior-driven development (BDD).
  • TestNG is used for testing at different levels using Unit testing and Functional testing. Basically, it can be used to test low-level to high-level functions, while Cucumber is used for functional testing of high-level functions with multiple scenarios.
  • TestNG is good for testing individual test cases, but is not easy to read for non-technical people, whereas Cucumber implements tests using the same language that is used to discuss them with the business team.
  • Both frameworks support parallel testing.
  • Both TestNG and Cucumber are open-source and free.

Cucumber vs Playwright

  • Both Playwright and Cucumber are open-source and free.
  • Both frameworks support a variety of programming languages, including JavaScript, Python, TypeScript, and C#.
  • Both frameworks support parallel testing.
  • Cucumber is based on the BDD approach, while Playwright is based on the TDD approach.
  • Cucumber uses natural language to write test cases, while Playwright uses special language to write test cases.
  • Cucumber is easier to use than Playwright.
  • Playwright is more powerful than Cucumber.

Cucumber vs Cypress

  • Cucumber is based on a BDD (Behavior Driven Development) approach, which means that test cases are written in natural language that is understandable to both testers and developers, while Cypress is based on TDD (Test Driven Development).
  • Cucumber supports a variety of programming languages, while Cypress only supports JavaScript and TypeScript.
  • Cucumber does not support performance testing, while Cypress does.
  • Both frameworks are open-source and free.
  • Both Cypress and Cucumber support API testing.

Cucumber vs Robot Framework

  • Cucumber is primarily associated with behavior-driven development (BDD) and is written in the Gherkin language. Robot Framework, on the other hand, uses a keyword-based approach and allows testers to write test cases using keywords and parameters, making them easier to understand and maintain.
  • Cucumber offers more flexibility in terms of programming languages, the Robot Framework is implemented using Python, and it primarily supports Python for writing test cases.
  • Both frameworks have a large and active community with extensive documentation and tutorials.
  • Cucumber can be used with various testing tools such as Selenium and WebDriver. The Robot Framework is primarily used with Selenium.
  • Cucumber provides various reporting options including HTML, JSON and XML. The Robot Framework provides a single HTML report.
  • Cucumber is generally considered easier to use than the Robot Framework, especially for testers with no programming experience.
  • The Robot Framework is more flexible and extensible than Cucumber.
  • Robot Framework is more widely used in companies than Cucumber.

Cucumber vs Jbehave

  • Both frameworks use Gherkin syntax for writing tests.
  • Both frameworks support a variety of programming languages including Java, Python and Ruby.
  • Both frameworks can be used to automate different types of tests including unit tests, integration tests and end-to-end tests.
  • Both frameworks are open-source and can be used for free.
  • Cucumber is a pure BDD framework, while JBehave is a hybrid framework that supports both BDD and TDD (Test Driven Development).
  • Cucumber strictly uses Gherkin syntax, while JBehave allows more syntax flexibility.
  • Cucumber can be used with a variety of testing tools such as Selenium and WebDriver. JBehave is primarily used with Selenium.
  • Cucumber provides various reporting options including HTML, JSON and XML. JBehave provides a single HTML report.
  • Cucumber is generally considered easier to use and understand than JBehave, especially for testers with no programming experience.
  • JBehave is more flexible and extensible than Cucumber.
  • Cucumber is more widely used than JBehave.

Cucumber API testing

Cucumber can be used to automate API testing. If you want to automate API testing with Cucumber, you’ll need to use a testing tool like RestAssured or Postman. These tools allow you to send HTTP requests to APIs and parse the responses. You can then use Cucumber to write tests that validate the expected API behavior.

Here’s Cucumber API testing example that returns a list of products.

Gherkin Style:

Scenario: Get the product list

When I send a GET request to “/products”

Then I should receive a response with status code 200 OK

And the response body should contain a list of products

This test sends a GET request to the /products API endpoint and confirms that the response has a 200 OK status code and that the response body contains a list of products.

API testing in Cucumber can be used to test all aspects of the API:

  • authentication,
  • authorization,
  • input verification,
  • verification of outputs,
  • performance,
  • scalability.

You can read more about Gherkin’s style of language here.

Cucumber installation

Prerequisites: Java JDK, Eclipse. Detailed instructions on how to install Java and Eclipse IDE on Windows can be found here.

Follow these steps to install Cucumber on Windows:

  1. Open Eclipse and click on the Help item in the top bar. Then click on “Eclipse Marketplace”.

Cucumber installation on Windows

2. You will see this window. Type “Cucumber” in the search bar and press Enter. Now press the Install button.

Cucumber installation on Windows

3. Click “I accept the terms of the license agreement” and then click Finish.

Cucumber installation on Windows

4. Now check the Authority / Update Site and Trust Selected checkboxes.

Cucumber installation on Windows

5. Now restart Eclipse.

Cucumber installation on Windows

6. Cucumber should be successfully installed. You can verify this by clicking on Help -> About Eclipse IDE.

Cucumber installation on Windows

7. When you see this window, click on “Installation details”.

Cucumber installation on Windows

8. If you find Cucumber Eclipse in the list, the installation was successful and you can start testing.

Cucumber installation on Windows


Cucumber is a powerful open-source test automation framework that enables natural language test writing and supports Behavior Driven Development (BDD). Its flexibility in supporting a variety of programming languages and integration with many testing tools such as Selenium and Capybara make it an attractive choice for projects of different sizes and types.

Despite some challenges such as test maintenance with frequent application changes, Cucumber provides a simple and effective test automation solution that is accessible to both technical and non-technical users.

If you speak German and are looking for a job as an IT tester, take a look at our employee benefits and respond to the latest job offers.

About the author

Michaela Kojnoková

Agile Test Engineer

Po štúdiu informatiky na ŽU a TUKE som sa najviac ponorila do oblasti automatizácie testovania. Okrem toho sa venujem tvorbe webov, databázam, dátovej analytike, umelej inteligencii a strojovému učeniu. Mám rada cestovanie, šport a najviac si užívam čas strávený v prírode s mojimi blízkymi. LinkedIn

Let us know about you