Websocket Connection Test in JMeter
In this post, we will see about the web socket connection test in JMeter.
Step 1: Open the Apache Jmeter and create the new test plan.
To begin the Websocket connection in JMeter, follow these steps:
Step 2: Download the WebSocket plugin for JMeter from the following link: WebSocket Plugin Download- https://jmeter-plugins.org/files/packages/websocket-samplers-1.2.8.zip
- Install the plugin by placing the JAR file in your JMeter installation's “lib/ext” directory.
- Restart JMeter to load the WebSocket plugin.
Step 3: Enter the No.of threads(users) and ramp-up period (seconds) in Thread properties
Step 4: Set CSV Data Config by right-clicking Thread users-> Add-> Config-> CSV data config. This option is for running the different users multiple times.
Step 5: Configure WebSocket Open connection by right-clicking Thread users->Add->Sampler->Websocket open connection.
- Set the Server URL.
- Server name or IP — Configure the server name of our application as specified in Fig 1.1
- Port — Port number of which our application is running.
- Path — The Path of the API.
- Connection timeout — It should always default 20000(ms).
Step 6: Configure WebSocket Ping/Pong by right-clicking Thread users->Add->Sampler->Websocket Ping/Pong. Select the Pong option for receiving the response from the Websocket. WebSocket ping/pong should be under the Loop Controller.
Step 7: Select the Constant Timer by right-clicking the Add->Timer->Constant timer. This will make the request to wait for same amount of time.
Step 8: Configure the View results in tree or table for the test results.
Step 9: Exporting results to excel — Add->Listener->Simple Data Writer.
Step 10: Verify all those above configuration is correct and run the test.
Thank you!!!!