In Cucumber 'Feature file '-> 'Examples' , how to set path for CSV file

前端 未结 2 1144
余生分开走
余生分开走 2021-01-26 19:02

My sample feature file rather than giving data from Examples I want it to pass from csv how to achieve that can anyone help me out.

Feature file:

Feature         


        
2条回答
  •  失恋的感觉
    2021-01-26 19:54

    Not directly. However, you can have a record ID (or test case number) of sorts in the Example table. You can then retrieve records from the CSV in the step code based on the ID.

    Scenario Outline: Rocky Search Status with Filters
        Given Open firefox and start application for Rocky Search Status
        When User enters data specified in test case 
        Then Message displayed Rocky Search Status Successful
        Then Application should be closed after Rocky Search Status
    
        Examples: 
         |tcn|
         |1  |
         |2  |
    

    The "When" step will use the tcn to retrieve the corresponding record from the CSV.

提交回复
热议问题