问题
I get a value in the response by running one of the scenarios and I would like to use that value in the next scenario. Is there a way to set variables in the context of a feature with karate? I know I can call another feature from within the feaure, but I don't want to move that scenario in another feature and do the call.
回答1:
Please note that having scenarios depend on another is considered a bad practice, and I don't recommend it: https://github.com/intuit/karate#script-structure
But please refer this section on "hooks": https://github.com/intuit/karate#hooks
来源:https://stackoverflow.com/questions/54182312/is-there-a-way-to-set-variables-in-a-scenario-and-use-them-in-another-scenario-i