2
votes

After recording script, I have added 'Cookie Manager'. 2. While running, Cookies are not showed for Request headers in Jmeter and the Connection closed error showing for listener. But, Browser cookies are passing the request headers in my application.

So, How can i pass cookies in jmeter. kindly give me a solution. Please refer the snapshot.

enter image description here enter image description here

Thanks, Vairamuthu.

2

2 Answers

1
votes

Just add to Test Plan an HTTP Cookie Manager before your request.

1
votes

I don't think you should be sending cookie. I would rather expect that you need to extract the value of this _xsrf cookie from the /api/login request and add the extracted value as X-Xsrftoken header.

  1. Add the next line to user.properties file (located in JMeter's "bin" folder"

    CookieManager.save.cookies=true
    

    and just in case this line as well:

    CookieManager.check.cookies=false
    
  2. Restart JMeter to pick the properties up
  3. Add HTTP Header Manager to the request which is failing
  4. Make sure it contains the following like:

    • Name: X-Xsrftoken
    • Value: ${COOKIE__xsrf}

More information: