【问题标题】:Karate - response cookies not being passed automatically to the next request空手道 - 响应 cookie 不会自动传递给下一个请求
【发布时间】:2021-04-07 15:52:37
【问题描述】:

当我从不同的功能文件调用第一个请求时,第一个请求的响应 cookie 没有传递给下一个请求 以下是我的代码:

##First request##
Given def createUserResponsePayload = call
read('classpath:helper/bi/createBiAccount.feature@createBiUser')

## Second request##
    * def updateBIAccountNegativeRequestPayload = read('classpath:data/atg/payload/bi/updateBIAccount.json')
    * set updateBIAccountNegativeRequestPayload.!gender = 'female'
    Given path '/v1/bi/account'
    When request updateBIAccountNegativeRequestPayload
    When method PUT
    Then status 200

目前我们正在使用以下解决方法,@PeterThomas 如果您有更好的解决方案,您能否提出建议?

And cookie JSESSIONID = createUserResponsePayload.responseCookies

【问题讨论】:

    标签: karate


    【解决方案1】:

    这是意料之中的。传递变量和响应是您的责任。

    如果您使用“共享范围”,您可能不必这样做:https://github.com/intuit/karate#shared-scope

    【讨论】:

      猜你喜欢
      • 2020-11-08
      • 1970-01-01
      • 2018-06-22
      • 1970-01-01
      • 2020-07-31
      • 1970-01-01
      • 1970-01-01
      • 2020-03-10
      • 1970-01-01
      相关资源
      最近更新 更多