Passing data between scenarioes in karate

拟墨画扇 提交于 2019-12-11 09:49:31

问题


I have a requirement to pass the response of first web services to next service. We maintain one scenario for each web services. Some of the tags in first services needs to be passed to next web services within the feature file itself. Please help.

Thanks, Thiyagu


回答1:


I think you have fundamentally misunderstood the way a Scenario works. Each Scenario is supposed to be independent. You can't have one Scenario update a variable and then expect that other ones can see the updated value. Please combine your 'flows' into one Scenario. Or if some 'setup' steps are common, use a Background section.

Keep in mind that you should be able to comment-out a Scenario or skip some via tags without impacting any others.



来源:https://stackoverflow.com/questions/49312049/passing-data-between-scenarioes-in-karate

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!