1

This is my feature file:

 * def Json = read ('1.json')
    * print Json.Id
    * set Json.Id = Product_Num
    * print Json.Id

I want to replace my Id with new Product number. After run Karate, I see the result is correct, new Product_num is put out (by the second print out result)

But id value doesn't update in 1.json file.

How to update 1.json file values? I need to replace id values in 1.json file

Napoli
  • 1,389
  • 2
  • 15
  • 26
qalinda
  • 31
  • 1

1 Answers1

0

You are trying to write to a file. This is normally never needed when you use Karate, and hence is not supported directly. Do you want your test data changing all the time because your tests are updating the files from which test data is being read ? I don't think so.

Please read this answer for details: https://stackoverflow.com/a/54593057/143475

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248