Search code examples
jsonkarateconsolidation

Is there any way to save response of each iteration of Scenario Outline to a variable and consolidate all the responses into a single json file


enter image description hereI'm trying to save the json response of each iteration of the Scenario Outline and consolidate all the responses into a single json file. But i'm unable to save it in the current feature file nor in any other feature file. Is there any solution to this problem. I tried saving the response to a text file using java which is working fine. But i dont want to make use of files which is not advisable. Is there any better way to do this? Any suggestions would help. Thanks in advance.


Solution

  • A Scenario Outline does not give you any control of "before" and "after" the entire set of Examples.

    So please consider an alternative approach to "loop" which will give you what you want: https://github.com/karatelabs/karate#data-driven-features

    If that doesn't help, please assume that what you want is not supported by Karate. Also read this: https://stackoverflow.com/a/54593057/143475