Shivam Gupta
Shivam Gupta

Reputation: 77

How to set value in CSV file in Karate

I am reading some test userid and password from csv file. and want to store id(combination of id and password and some random text) for each userid and password using karate.

Feature: setid

Scenario Outline: set authid

* def authId = '<username>' + '<password>' + 'test'

* print authId

* set <id> = authId

Examples:

  | read('testdata.csv') |

testdata.csv

username,password,id

shivam,abc,

rahul,pqr,

While running above code i am getting error datatest.feature:5 - no step-definition method match found for: set = authId

Can anyone help me where i am missing.

Upvotes: 0

Views: 1064

Answers (1)

Peter Thomas
Peter Thomas

Reputation: 58058

Sorry you can't update a CSV data source like that. Please use Java code, as what you seem to be trying to do is something specific and not normal API testing related.

Upvotes: 1

Related Questions