在空手道中的场景之间传递数据 [英] Passing data between scenarioes in karate

查看:48
本文介绍了在空手道中的场景之间传递数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将第一个Web服务的响应传递给下一个服务.我们为每个Web服务维护一个方案.首先服务中的某些标签需要传递到功能文件本身内的下一个Web服务.请帮忙.

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.

谢谢, 提雅古

推荐答案

我认为您从根本上误解了Scenario的工作方式.每个Scenario应该是独立的.您不能让一个Scenario更新一个变量,然后期望其他变量可以看到更新后的值.请将您的流程"合并为一个Scenario.或者,如果某些设置"步骤很常见,请使用Background部分.

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.

请记住,您应该能够注释掉Scenario或通过标记跳过某些内容,而不会影响其他任何内容.

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

这篇关于在空手道中的场景之间传递数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆