0

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. Commented May 25, 2012 at 21:57

1 Answer 1

1

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'.

Sign up to request clarification or add additional context in comments.

2 Comments

oh!!! not sure why mine doesn't work.. can you please tell me if it you are using 2.6 version of jmeter?
I'm using JMeter 2.3.4 (which comes by default in ubuntu). Side note: Just make sure the Header 'ETag' is being sent by the server (if apache this may help Apache FileETag )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.