Cucumber Selenium using Excel File as Data Table

前端 未结 1 430
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-11 12:11

I am using Cucumber-Selenium and Excel as my Data file, my question is how can I run my feature file multiple time based on the data I have on the Excel. For Example I have

相关标签:
1条回答
  • 2020-12-11 12:37

    If you want to iterate of the content in an Excel sheet you need to implement that in code in the step definition. There is no support for doing it in Gherkin.

    Apache POI may be an option when implementing the iteration.

    It is important to understand that the purpose of Behaviour-Driven Development, BDD, is communication. Gherkin is one way of communicating. The Gherkin scenarios can be read and understood by almost anyone understanding the problem.

    If you have some of the truth in Gherkin and some in Excel you will end up in a situation where you don't use Cucumber and Gherkin for communication but rather as a test tool. This may be ok. But if you use Cucumber as a test tool, there are other tools that may be easier to use. JUnit is one of them.

    0 讨论(0)
提交回复
热议问题