问题
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