la1
la1

Reputation: 539

Not able to get cookie value as Jmeter variable (HTTP cookie manager) which doens't have label

Not able to get cookie value as Jmeter variable (HTTP cookie manager) which doens't have label.

In our .Net application, there are 3 cookie values in the request as given below:

Cookie:ASP.NET_SessionId=1axjnxqp; xx yy Pvt. Ltd.; compNameSelected=xx yy Pvt. Ltd.

if observed, the middle value doesn't have label (xx yy pvt. ltd). This value is not being captured as cookie in subsequent requests though added HTTP cookie manager, updated user.properties file with CookieManager.save.cookies=true.

Used Debug sampler, only two ASP.NET and comNameSelected are shown.

Please suggest and guide.

Upvotes: 1

Views: 1720

Answers (2)

Ori Marko
Ori Marko

Reputation: 58882

Follow @Dmitri T answer with a small change to make it work:

In the Regular Expression Extractor, On Field to check choose Request Headers

It will get cookie value from request.

Upvotes: 0

Dmitri T
Dmitri T

Reputation: 168207

You can extract cookies from Set-Cookie response header using Regular Expression Extractor configured like:

  • Reference Name: anything meaningful, i.e. cookies
  • Regular Expression: Set-Cookie: (.*)
  • Template: $1$
  • Match No: -1 (just in case there will be > 1 "Set-Cookie" header)

JMeter Extract Cookies

References:

Upvotes: 0

Related Questions