'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 1:[1]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1