Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I’m new to Jmeter and I am currently testing a web application using Jmeter. When I’m trying to record using "HTTP(S) Test Script Recorder", Jmeter records 'two' HTTP Request for 'one' static screen (I am not performing any other functionality on screen). Also, when I tried to investigate I came to know that the only difference is, in second HTTP Request, "Content encoding = utf-8". When I ran this Test Plan, I noticed that in “View Result Tree”, under Request tab, value of “Accept” and “Referer” fields are getting changed.

My query: Is this application is sending request twice for each screen? Or I’m missing something? Or this behavior is intended behavior?

Example: Below is sample output form from a static screen named Image Gallery- First on View Results Tree:

  1. Request Headers:
  2. Connection: keep-alive
  3. Accept-Language: en-US,en;q=0.5
  4. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  5. User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0
  6. Referer: http://Applicationname.com/
  7. DNT: 1
  8. Accept-Encoding: gzip, deflate
  9. Host: (Application-name).com

Second outcome on View Results Tree:

  1. Request Headers:
  2. Connection: keep-alive
  3. Accept-Language: en-US,en;q=0.5
  4. Accept: image/png,image/*;q=0.8,*/*;q=0.5
  5. User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0
  6. Referer: http://applicationname.com/tof.AN.UI/Product/IdeaImageGallery
  7. DNT: 1
  8. Accept-Encoding: gzip, deflate
  9. Host: Applicationname.com

Please help me understand this and kindly excuse if my question is very basic.

Thank you in advance for your precious time!

Note: I tried to research for content encoding and I found this on stack overflow. http://stackoverflow.com/questions/17154967/is-content-encoding-being-set-to-utf-8-invalid

share|improve this question

3 Answers 3

The second request is image which is somewhere at the page you're hitting with the first request. I believe that it should be expected for image gallery to have some images.

I would recommend to delete the second request from recorded samples and use HTTP Request Defaults configured to Retrieve all embedded resources and use pool of 3-5 threads for it as this is what real browsers do.

See How to make JMeter behave more like a real browser guide for another piece of advice on how to make your test more realistic.

share|improve this answer
    
Thank you for your answer @Dmitri. I have already added the components mentioned in the link. Also, I have added the HTTP Request Defaults. I just wanted to confirm that, Can I delete the second request. Thank you, your answer was helpful!! –  Committed to quality Jul 16 at 11:55

Try using a network analyser / packet sniffer such as Fiddler to get a trace of a browser's normal http/https requests, and compare with what JMeter has been recording?

share|improve this answer

@Dmitri T hit the nail on the head, but I wanted to walk you through a little about how you could deduce the origin of the request. Looking at the headers you posted, you can clearly see more differences than just the content-encoding. The following lines also differ in important ways:

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8

Vs

Accept: image/png,image/;q=0.8,/*;q=0.5

and

Referer: http://Applicationname.com/

vs

Referer: http://applicationname.com/tof.AN.UI/Product/IdeaImageGallery

To debug this, you'll want to look at the page being hit. Where is something referring to IdealImageGallery? By the accept header, it's looking for a .png file at that location. By your description of the page as an image gallery, you can tell that it is probably looking for an image in the gallery.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.