Pages

Data Tables in Cucumber

Data Tables in Cucumber?

  • DataTable plays a vital role in the cucumber framework.
  • Datatable handles large amounts of data or multiple sets of data.
  • Datatable is Immutable and thread-safe.
Demo on Cucumber DataTables:

Let's say I have a scenario like below:

Scenario: data table scenario with single row
Given I have single row of test data
| This Scenario is for single row of data |



The above scenario has a table with a row of data and we can implement a step definition based on errors got in the console.
cucumber datatable
cucumber datatable
Below scenario having a single column of test data:
Scenario: data table scenario with single column
Given I have single column of test data
Row1 |
Row2 |
Row3 |
Row4 |
We can implement the above scenario by using List<String>
cucumber datatable
cucumber datatable

Please comment below to feedback or ask questions.

No comments:

Post a Comment

Please comment below to feedback or ask questions.