JMeter - HTTP2 Request doesn't save MD5 hash - jmeter

I'm submitting HTTP2 Request and checking Save response as MD5 hash?
Tried both in HTTP2 Request and HTTP2 Request Defaults, but response isn't MD5, just show normal response
I tried to view it using listeners: View Result Tree Http2 and View Result Tree
Is it working somehow or is it a missing?
Note after checking checkbox inside HTTP2 Request and focus on other element and return, the checkbox is off
Also I tried changing protocol to http and it's ignored (use https)

You cannot save response data as MD5 hash due to the asynchronous nature of the responses, if for some reason you want the response hash you can tick Synchronized Request box and use i.e. JSR223 PostProcessor or __digest() function to calculate the hash of the response for later reuse
I don't think you can use HTTP protocol as HTTP2 sampler relies on alpn-boot library which assumes TLS transport
More information: The New HTTP/2 Plugin for JMeter

Related

JMeter - websocket plugin - forbidden error

We are trying to test a WebSocket communication using the JMeter plugin(WebSocket request-response Sampler) by Peter Doornbosch. Headers are sent appropriately, response headers are received as intended with Response code:101. But the message says {"message": "Forbidden", "connectionId":"xxxxxxxx=", "requestId":"xxxxxxxx="}.
"Headers are sent appropriately" - I doubt this is the case.
Compare requests which are being sent by JMeter and by the real browser (or other WebSocket client application) using an external sniffer tool like Fiddler or Wireshark - the requests must be exactly the same (apart from dynamic values which need to be correlated).
Given you will be sending the same request with JMeter as the real browser does you will be getting the same response
Also it might be the case of missing authentication/authorization token which is normally being added to the URL

Possible if want to do API Load Testing using JMeter with URI info only?

My team planned to do API Performance Testing using JMeter 5.0 for my client. My client developed the API in Kubernetes. Just wondering, they gave info such as URI, HTTP Method and Content-Type only. We never have experience using URI. Are these info sufficient to do load test in JMeter? And where do I fill in these info? Is it in Config Element: HTTP Header Manager?
Because usually I only do my enablement using sample website which already provide the URL.
Do I need to ask them to provide the specific URL for this? Or URL can be extracted from URI?
Thanks.
Normally you should put:
Protocol, server name or IP and Port Number into HTTP Request Defaults, this way you will have a single configuration element having these details and in case of change you will need to introduce the change at one place only and won't have to revisit each and every HTTP Request sampler
Individual requests are defined using individual HTTP Request samplers where you need to provide URL Path and request body (if any)
Content-Type and other Headers can be provided via HTTP Header Manager, the same Scoping Rules as for HTTP Request Defaults apply, for example if you want to send application/json for all the requests just add HTTP Header Manager on the top of your Test Plan and it will add the header to all HTTP Request samplers which are at the same level as the HTTP Header Manager or lower.

How to wait until receiving multiple websocket responses send in sequence, for a single request sent, using JMeter

I am using the Jmeter WebSocket Sampler. I have successfully connected to the websocket, and can send a json request. It is a chat bot, and I will be validating it's response.
However, I have observed in websocket log, the websocket responds to the json request with a short confirmation response before the actual response.
for example, the first response is {"event":joingame,} where the response is {"event":"game"}. I don't really need this information.
Only then is the real response sent (as I observed in webscoket log)
I have tried the general Websocket Sampler.
The websocket responses come in "frames", each having a JSON response, my samplers are closing right after the first frame.
You might want to switch to the WebSocket Samplers by Peter Doornbosch which can be installed using JMeter Plugins Manager
This way you will be able to establish a connection first:
and then continue reading the frames re-using the connection unless you find the frame with the content you're looking for:
It makes sense to use JSON Extractor and While Controller in order to continue reading until the anticipated text appears in the response.
More information: JMeter WebSocket Samplers - A Practical Guide

How to manually add WebSocket Header in Jmeter?

I am using jmeter plugin (WebSocket Samplers by Peter Doornbosch) for creating websocket requests manually.
Opening the connection to websocket
I use "Websocket Open Connection" sampler.
Fill all details (server,port,path)
The connection also requires sessionID.
I tried http header manager but it doesn't takes up the header while execution.
SO, is there a way to manually add websocket header to the (Websocket open connection) sampler?
Http Header Manager is the way to go; the sampler picks up all the headers, except the ones that are used by the WebSocket or HTTP protocol itself (e.g. "Host", "Sec-WebSocket-Key"). If your header is called "sessionID", it definitely should work. See also the "Basic request-response sample with Header and Cookie Manager.jmx" example in the samples directory (https://bitbucket.org/pjtr/jmeter-websocket-samplers/src/master/samples/)
Are you 100% sure the sampler did not include the header? Did you check the HTTP GET request with a tool like WireShark?

an image response contains http status code 200 means it fetched to client browser?

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?
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.
In the "Advanced" tab of your HTTP Request sampler tick "Save response as MD5 hash" box
Add ND5 Assertion as a child of the HTTP Request and put your image's MD5 checksum into the input field
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
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:

Resources