Karate - response cookies not being passed automatically to the next request

Viewed 223

When I'm calling first request form different feature file, the response cookies of first request has not being passed to next request Below is my code:

##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

Currently we are using below work around, @PeterThomas could you suggest if you have any better solution?

And cookie JSESSIONID = createUserResponsePayload.responseCookies
1 Answers
Related