Search code examples
javaseleniumcucumbertestngdataprovider

Avoiding examples in cucumber


Please let me know how can I skip using examples for test iterations in Cucumber? I want feature files should have only test steps and in step definition I want to use something like testng dataprovider for iterations. I tried data provider but since it works with @Test tag, looks like its not a feasible solution. Any help?


Solution

  • I believe that it is not possible because scenario outline works with example table to run the same scenario with the different values. But if you want to reduce the size of example table then I prefer you add data in the JSON file and then add the keys here in the example table and then search for the data with the help of those keys :) In case if you have single line of data then you can use before and after hooks in cucumber and try to update the data with the help of hooks.