1

I have a feature file with 5 test cases and the request body for each has different parameters:

TC1 - Request has 1 id, TC2 - Request has 2 ids, TC3 - Request has firstName, lastName, TC4 - Request has 2 ids, firstName, lastName, TC5 - Request has 1 id, firstName

I want to externalise the data for all the test cases. I wen through the karate documentation where i can use scenario outline and call csv in the example.

But the question is : If i have different data set (as per the difference in the request body) for each of the test cases so do i need to create separate csv files for each test case? If a single csv could be used, please help me how can i do that?

user1873274
  • 181
  • 1
  • 9
  • please don't do this. read the linked answer very carefully. if still not satisfied, open a new question, but I won't answer it – Peter Thomas Aug 20 '20 at 19:08
  • I guess i wasnt able to make it understand correctly Peter. The link you mentioned is the issue for comparing 2 json objects. However my current question is about data driven test cases wherein i want to read the test data from csv file. I am aware of using the csv file for test data. The only confusion is ow do i use a single csv for different test cases. – user1873274 Aug 21 '20 at 05:23
  • if this link does not answer your question, please assume that Karate does not fit your requirement: https://stackoverflow.com/a/63139813/143475 and https://stackoverflow.com/q/62443586/143475 – Peter Thomas Aug 21 '20 at 05:30

0 Answers0