1

I want to pass browser automatically store cookies and manually added cookies in JMeter request. enter image description here

Default cookie manager to use to get default cookies to browser create into pet-type-3. HTTP Cookie Manager uses to add manually cookies to that request. but that request also passes only default requests in browser creation.

How to pass these two types of cookies in this request.

1 Answers1

1

Given you're providing valid cookies which match domain and path - they will be added along with the cookies coming in Set-Cookie response header

Demo:

enter image description here

as you can see by cookie foo with the value of bar has beed added to the "normal" cookies used by google

So I believe you just need to move your HTTP Cookie Manager to be direct child of the Thread Group as currently it's being applied to /pet-type-3 sampler only and in order to catch the cookies you call "browser" ones it need to be applied to all HTTP Request samplers.

More information: JMeter Scoping Rules - The Ultimate Guide

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • I want to pass pet-name-2 parameters (person reference,quotereference)as a cookie therefore I add HTTP cookie manager inside that request I cant add initially that manually cookies. – lahiru dilruwan Oct 06 '21 at 15:25
  • 1
    You still need to have the top-level HTTP Cookie Manager in order to capture the cookies from previous requests. Overrides for a single request can be done on per-request level, multiple cookie managers are being merged. See [HTTP Cookie Manager Advanced Usage - A Guide](https://www.blazemeter.com/blog/http-cookie-manager-advanced-usage-a-guide) article for more details – Dmitri T Oct 06 '21 at 16:51
  • I try to pass JSON extract variable in cookie manager but it passes like a string ${personref},${proprtyref}. But I try to pass normally variabe date like its pass correctly – lahiru dilruwan Oct 06 '21 at 18:29