简体   繁体   English

有什么方法可以将场景大纲的每次迭代的响应保存到一个变量中,并将所有响应合并到一个 json 文件中

[英]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

在此处输入图像描述 I'm trying to save the json response of each iteration of the Scenario Outline and consolidate all the responses into a single json file.我正在尝试保存场景大纲每次迭代的 json 响应,并将所有响应合并到一个 json 文件中。 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.我尝试使用运行正常的 java 将响应保存到文本文件。 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.提前致谢。

A Scenario Outline does not give you any control of "before" and "after" the entire set of Examples . Scenario Outline不会让您对整个Examples集的“之前”和“之后”进行任何控制。

So please consider an alternative approach to "loop" which will give you what you want: https://github.com/karatelabs/karate#data-driven-features所以请考虑“循环”的替代方法,它会给你你想要的: 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另请阅读: https ://stackoverflow.com/a/54593057/143475

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM