1

I need to pass values from my features to json files. Ex: an item is created in the test feature and id is returned in response; I would like to put this id in a json file where I have something as: {"item": ["string1", string2 etc..] } to concatenate the id in string1, string2

I saw an example here but it didn't help me for json files: https://github.com/intuit/karate/blob/master/karate-junit4/src/test/java/com/intuit/karate/junit4/demos/type-conv.feature

Thanks for help

1 Answer 1

2

Use the set keyword:

* def json = read('some.json')
* set json.item[] = 'string3'
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.