cindy87
cindy87

Reputation: 57

Is there a way to pass excel data to cucumber scenario

I'm working on an application where i need to create cases based on the data present in the excel sheet. For now it working perfectly, but i have new requirement where i need to run the same cucumber scenario for multiple times until it creates cases for all rows presented in the excel sheet.

Feature: User wants to create Applications from Online channel.

Scenario Outline: User wants to generate Application type A
When I open forms website
And click application link
Then I enter application reference with excel row "<row_index>" dataset

Examples: |row_index| |2| |3|

In the excel file i have multiple sheets relevant to each scenario. But the row count in each sheet in the test data file is not a fixed count, sometimes it may have only one row, 3 rows or sometimes it may have 10 rows. Due to that how will i pass the row count as it might get change time to time.

Can someone help me on how to handle this scenario? Do we have any other way of accessing excel sheet from scenario outline?

Upvotes: 0

Views: 1145

Answers (2)

Aslak Helles&#248;y
Aslak Helles&#248;y

Reputation: 1191

We have a discussion about this at https://github.com/cucumber/cucumber/issues/773

Upvotes: 0

Vincent
Vincent

Reputation: 630

As far as I know, this is not currently possible. That's part of our plans to support Excel in the future.

Right now, the way I would handle that would be to use some templatin engine and generate the Gherkin file with the Excel content as part of the build, right before running the tests.

Upvotes: 0

Related Questions