Cucumber Data Driven Testing

Profile picture for user devraj
Submitted by devraj on

Data Driven Testing is a Test design and execution strategy where the test scripts read test data from data sources (file or database) such as ADO objects, ODBC sources, CSV files, JSON etc. rather than using hard-coded values.

Data driven testing means to execute your test case multiple times with different inputs and validation values. Cucumber inherently supports Data Driven Testing using Scenario Outline and example but with power of Java you can not limit Cucumber data driven testing to just feature file.

When you have large amount of data it is recommended to use external file otherwise you can use scenario outline.

There are different ways to use the data insertion with in the Cucumber and outside the Cucumber with external files: