1

I have created cucumber feature file. As of now I am giving input from scenario outline with Examples.

But My test data is very huge now. I just want to give input from CSV or EXCEL.

Could you please explain How to achieve this ?

  • 1
    You can't read the data directly via Gherkin without a [workaround](https://stackoverflow.com/questions/50388384/in-cucumber-feature-file-examples-how-to-set-path-for-csv-file), but since you are using Java, you have a full programming language to use for reading Excel or csv wo=ith POI for example. – ou_ryperd Dec 14 '20 at 08:40
  • yes, thank you form replying , i am trying to code it on java, is there any existing library that imports data from excel thank you – zakaria janah Dec 14 '20 at 13:57
  • I already said, Apache POI – ou_ryperd Dec 14 '20 at 14:54

1 Answers1

3

If you are using cucumber version 5+ you can use qaf-cucumber that will enable external test data with in-built data providers and many other features from qaf. Below is example of test data from CSV usage. You can switch to any available data-provider or you can create custom as well.

Feature: my feature    

@dataFile:resources/data/testdata.csv
Scenario: my scenario
...
user861594
  • 5,733
  • 3
  • 29
  • 45