Jobs
Jobs

Reputation: 1317

JMeter Configuration for Websocket Broadcast

I have a Nodejs WebSocket application which 1) Accept a connection 2) Sends a message ( Say 'Start' ), and will be added to a broadcast room. The response is 'Added to broadcast room' 3) All connected clients will get broadcasted messages.

The program is working fine with multiple clients and all getting broadcasted messages.

I am facing difficulty in simulating the same in Jmeter.

I have added - WebSocket - Open Connection ( which opens a connection ) - Working fine - WebSocket - Request-Response sampler (Sends 'Start' and getting 'Added to broadcast room' ) - working fine

But the connected clients not getting broadcasted message from the server. How to create something like ws.onmessage = function(e) {} in jmeter.

Your help is appreciated.

Upvotes: 0

Views: 66

Answers (1)

Peter
Peter

Reputation: 847

Just add a "Single Read Sampler" to read a message sent by the server; put it in a loop to keep reading.

Upvotes: 0

Related Questions