Reputation: 109
I need to create data driven unit tests for different APIs in karate framework. The various elements to be passed in the JSON payload should be taken as input from an excel file.
Upvotes: 3
Views: 11235
Reputation: 58088
A few points:
call-table.feature
and dynamic-params.feature
call-json-array.feature
Map
/ List
form, it will be ready for Karate to use. This example shows how to read a database via JDBC: dogs.feature
. So although this is not built into Karate, just write a simple utility to read a CSV or Excel file and you can do pretty much anything Java can do.EDIT: Karate now supports CSV files that can be used to even do data-driven testing: https://github.com/intuit/karate#csv-files
Upvotes: 4