In Karate, we are parameterizing with the below values. Do we have any option of passing the table as external file in karate.
And table tablename
| name | age | id |
| abc | 02 | 01 |
| def | 03 | 02 |
And def values = { "name": '(#name)', "age": '(#age)', "id" : '(#id)' }
Expecting below in karate framework.
And table <tablefile.xls>
And def values = { "name": '(#name)', "age": '(#age)', "id" : '(#id)' }
There are multiple ways, the most recommended is to use JSON for maintaining test data.
Please take a look at this answer for details: https://stackoverflow.com/a/49031155/143475
EDIT: Since OP is insisting on Excel, please refer to this other answer where this is explained in detail: https://stackoverflow.com/a/47954946/143475
If I were you I would NOT use Excel and at least use CSV. In my opinion
table
orset
is far easier to maintain than Excel and you can do it as part of your testfeature
file itself.