0
votes

How to use regular expression extractor to extract Etag from http-header response?

I've the following output from my get and I want to extract Etag and use it in my next case where i've to pass it in my http-header to do If-None-Match. I've tried the following: \Etag:\s? and have chosen "Headers" in "Response Field to Check". But I don't see this value being sent to my header.

Thread Name: Fetch_Links 1-1
Sample Start: 2012-05-24 10:15:10 PDT
Load time: 135
Latency: 131
Size in bytes: 4950
Headers size in bytes: 641
Body size in bytes: 4309
Sample Count: 1
Error Count: 0
Response code: 200
Response message: OK 

I'm using 2.6 version of jmeter. Thank you in advance.

1
See also Phrases to avoid. -- And the ETag is typically absent for generated content. So you might not be able to find it, no matter the regex.mario

1 Answers

1
votes

I'm able to extract the ETag in JMeter (Regular Expression Extractor - Headers) with the following parameters:

Regular Expression: ETag: "(.*?)"

Template: $1$

Then add a HTTP Header Manager to pass the value of the Etag with 'If-None-Match'.