jmetersession-cookiesrecording

How to save cookies in jmeter recording and replay


Here i have two questions regarding capturing the cookies through JMeter. I am using JMeter recording to capture the web browser flow . And i have added Cookies Manager under the Test plan (common for all requests) Below is my flow :

launch >select Providers >sign-In

While recording it is capturing the cookies properly . i am able to see in the "Request Data" in "View Results Tree" . But while trying to replay i am not seeing the cookies in the results. Please let me know if i am missing some settings here.

How this will work when we increase the no of users and run. Thanks In Advance.


Solution

  • JMeter doesn't record cookies, if you add HTTP Cookie Manager to your Test Plan it will automatically extract the cookies from the application's Set-Cookie response header, parse them, validate and send with Cookie header during the next request.

    If you cannot see any cookies the reasons could be in:

    1. Cookies are invalid (i.e. expired, not matching the domain/path)
    2. Your test fails somewhere somehow, i.e. your sign-in request fails because you haven't implemented correlation of the dynamic parameters

    Inspect response details using "Response Data" tab of the View Results Tree listener and ensure that your test is doing what it is supposed to be doing as it looks like it doesn't go further than first page in your case