Reputation: 29
I am conducting a load testing using Jmeter to ensure massive of concurrent users able to request the image file from the server.
I have few question on the response code of the image(.png).
If the http status code is 200, does it mean the image fully fetched to the client from the server?
The response code is 200, image will still loading on the browser? or fully loaded?
Upvotes: 1
Views: 2000
Reputation: 6398
Following are the answers to your questions:
If the HTTP status code is 200
, does it mean the image fully fetched to the client from the server?
Yes. Once you receive the HTTP Response Code, it does mean that complete transfer of the response from Server to Client is done. Please go through TCP/IP model. Data is divided into small TCP packets by Server and Client will combine all of them to form the data (responsibility of Transport Layer). Add screenshot of Wireshark tool to highlight this behaviour.
The response code is 200, image will still loading on the browser? or fully loaded?
Image is fully received by the client (JMeter). But JMeter does not render the output on GUI, not just images any HTTP response. So, the response times of any HTTP requests doesn't include page rendering time, which is a major factor we should consider. if JMeter tells the HTTP response time is x seconds
, then from actual end-user perspective, it is x+browser rendering time.
Wireshark image:
Upvotes: 0
Reputation: 168082
HTTP is stateful protocol, therefore JMeter sends requests and has to wait for a response. If you getting http status code 200 it normally means that the request is completed successfully, so given your request is well-formed it should mean that the image is fully transferred.
However in some cases you may receive HTTP status code 200 which means that request has completed successfully on transport level, but in the response body you will get an error instead of the image. That's why I would recommend using MD5Hex Assertion which will automatically fail your HTTP Request sampler if image will be different from the expected one.
That's it, HTTP Request sampler will be failed if downloaded image MD5 checksum is different from the provided one
See How to Use JMeter Assertions in Three Easy Steps article for more information on conditionally setting pass/fail criteria on JMeter tests
Upvotes: 1