0
votes

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.

1

1 Answers

0
votes

You might want to switch to the WebSocket Samplers by Peter Doornbosch which can be installed using JMeter Plugins Manager

enter image description here

This way you will be able to establish a connection first:

enter image description here

and then continue reading the frames re-using the connection unless you find the frame with the content you're looking for:

enter image description here

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