0
votes

I am new to jmeter. I have setup up HTTP Request sampler to send GET request to google.com. The response I get is 200. But I could not find the response header where it shows the cookies in the response. I want to use that cookie value for my next request.

enter image description here

2

2 Answers

3
votes

You need to look into View Results Tree listener, Set-Cookie header will present in "Sampler Result" tab:

Sample Result

HTTP Cookie Manager should handle cookies automatically. Just in case if you need cookies to be store as JMeter Variables you can set the following property:

CookieManager.save.cookies=true

which can be done in 2 ways:

  1. Pass it to JMeter startup script via -J command line argument as:

    jmeter -JCookieManager.save.cookies=true
    
  2. Add aforementioned CookieManager.save.cookies=true line to user.properties file (located in "bin" folder of your JMeter installation) to make the change permanent. Remember, JMeter restart is required to pick the property up.

This way you will be able to access i.e. NID cookie value as ${COOKIE_NID} where required

Cookie as variable

See Using the HTTP Cookie Manager in JMeter guide for more information on using HTTP Cookie manager

0
votes

To handle the cookies automatically, Add HTTP Cookie Manager to the test plan by navigating to Test plan -> Add -> Config Element -> HTTP Cookie Manager.

And don’t test the applications which you don't own or have permission to test.