UTF-8 problem while testing a web application using jmeter



  • 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 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: Request Headers: Connection: keep-alive Accept-Language: en-US,en;q=0.5 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0 Referer: http://Applicationname.com/ DNT: 1 Accept-Encoding: gzip, deflate Host: (Application-name).com Second outcome on View Results Tree: Request Headers: Connection: keep-alive Accept-Language: en-US,en;q=0.5 Accept: image/png,image/;q=0.8,/*;q=0.5 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0 Referer: http://applicationname.com/tof.AN.UI/Product/IdeaImageGallery DNT: 1 Accept-Encoding: gzip, deflate Host: Applicationname.com Please help me understand this and kindly excuse me 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: https://stackoverflow.com/questions/17154967/is-content-encoding-being-set-to-utf-8-invalid



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


Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2