JMeter-WebSocketSampler icon indicating copy to clipboard operation
JMeter-WebSocketSampler copied to clipboard

How to receive continuous websocket response messages from server?

Open peer2peer opened this issue 10 years ago • 3 comments

In my scenario, I set up a websocket connection from JMeter to server. Then JMeter-WebSocketSampler send a text request in WebSocket to the server and the server will response the request with many continuous messages in WebSocket.

Now I have successfully received the 1st response message but then the WebSocketSampler thread and the threadgroup both end.

So my question is how to set up a test plan which could enable me receiving the continuous response messages from the websocket server.

peer2peer avatar Aug 17 '15 13:08 peer2peer

I added more websocket samplers without any messages sent out. Then one sampler will receive one following response. The issue is fixed partly but not perfect because I may have more following responses without ending.

e.g., sampler1: A --> B req 1 sampler2: A <-- B resp 1 sampler3: A <-- B resp 2 sampler4: A <-- B resp 3 ... ...

peer2peer avatar Aug 23 '15 02:08 peer2peer

An improvement:

add a loop controller to loop a sampler for receiving the response message in loop.

e.g., sampler1: A --> B req 1 sampler2: A <-- B resp 1 sampler3: A <-- B resp 2 loop: sampler4: A <-- B resp 3

peer2peer avatar Aug 23 '15 02:08 peer2peer

I got the same issue , I use loop too.... any improvement ? thx~

yxt105926 avatar Nov 02 '17 02:11 yxt105926