It’s apparent that the usage of Websocket has expanded greatly in recent years, and its reliability is expected to be high since it mostly carries crucial information to clients. Hence, testing their durability and reliability has become more important.
It is possible to execute performance tests on Websockets with Apache JMeter by using “Websocket Samplers” plugin developed by Peter Doornbosch.
Websocket Samplers Plugin
Let’s take a look at the plugin first. You can find the plugin here: https://jmeter-plugins.org/?search=websocket-samplers
Once you install the plugin, you will get 7 new Sampler elements:
Closes the current Websocket connection
- Websocket Open Connection
Initiates a new connection with given parameters, with options for connection&read timeouts
Performs a ping or ping/pong service for the current connection
A single sampler that performs one-time request.
- Websocket Single Read Sampler
Reads response without sending a request.
- Websocket Single Write Sampler
Sends a request without reading the response
- Websocket request-response Sampler
Does both sending a request and reading response