3

I’m new to Jmeter and I'm 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'm 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 sending request twice for each screen? Or am I missing something? Or is this behavior the 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 me if my question is very basic.

Note:

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

3 Answers 3

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.

1
  • 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!! Jul 16, 2014 at 11:55
0

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?

0

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

Your Answer

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

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