On Jmeter: View Result tree
: Request: Raw
Cookie Data:
.ASPXAUTH=EBB383A4DA12F0C106F044F70EC6CD6637252490DA31179407C466B8933D8B32622584F7A9F18A40C9D423078313E6ACB89519497CDDED451AF0C857AF3D6ED1C12296E56CE7D6058D7450E74B845EE39F3404925F679F180493329BDA021698
Regular expression extractor
Main Sampler Only
Request Headers
Regular Expression : Cookie Data:(.*)
Template : $1$
Match No : 1
Still getting Null
Value
Also tryed with
Cookie Data:\n(.*)
Please Suggest.
You can use the regular expression extractor to extract the key from the response of your first request and use the extracted key for subsequent requests. We call this JMeter Extract and re-use. Here are the steps: Right click on the first request and add post processor: Regular Expression Extractor.
Cookies are handled in JMeter using ‘HTTP Cookie Manager’. Using this config element you can simulate browser activities. HTTP Cookies Manager does work in two ways:
To demonstrate the use of the XPath extractor, let us assume the following response for one of my HTTP requests in JMeter: We can extract fromPort values and toPort values into two different variables and then pass it on to the next request.
Open Apache JMeter (here is how to start Apache JMeter on Mac) and right click Test Plan and Add -> Threads (Users) -> Thread Group 2. Right click Thread Group and Add -> Samplers -> HTTP Request
Given the value is stored in the HTTP Cookie Manager, you can access it using below steps:
CookieManager.save.cookies=true
line to user.properties file${COOKIE_.ASPXAUTH}
where required. See Using the HTTP Cookie Manager in JMeter article for more detailed explanation of the above steps
In Regular Expression Extractor, under Field to check
, please select Response Headers
radio button.
To save Cookies automatically, In jmeter.properties
file, set as following:
CookieManager.save.cookies=true
Restart Jmeter.
You can access the saved cookies with COOKIE
prefix.
example (in your case):
${COOKIE_Cookie_Data} # confirm the same in debug sampler result in View Results Tree
I strongly suggest adding Debug Sampler
& View Results Tree
, which shows the saved cookie values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With