1

I have sample JSON where all the values for the keys are defined in regex as "#(value)" and the values are dervied from the data table in the feature file. (represented in Example in scenario outline) eg:- {"key": "#(value)"}

I have one of the record which is like A'BC but when I pass this as it is the JS is getting failed with error as : Missing close quote

Example:-

| Value |

| A'BCD |

I tried passing the value with single slash \ in between A and 'BC but it is adding the double slash in the constructed JSON request

JSON constructed : {"key": "A\'BCD"}

I need the the JSON to be like {"key" : "A'BCD"}

Anyone can help please?

1 Answers1

0

Maybe you should use a strategy to "post process" the CSV. Refer: https://stackoverflow.com/a/72395151/143475 and Reading csv file converts it to json but it takes every row in it as a string in karate

Also be aware of ways to improve dynamic scenario outlines coming in the next version: https://github.com/karatelabs/karate/issues/1905

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