First step: Add WebSocket Sampler Components
You can use Plugins Manager to add, first download the Plugins Manager component;
Download path: https://jmeter-plugins.org/downloads/all/
After downloading, save to JMeter's Lib/ext path and then reopen JMeter to see this component:
Then, in Plugins Manager, search for the WebSocket component:
This completes the addition of the WebSocket sampler component;
Step two: Use JMeter for websocket connection testing
1. Add WebSocket Sampler test Plan
1) Select the right mouse button to select the thread group to add->sampler->websocket Sampler, such as:
2. Fill in the WebSocket connection information:
Server name or ip:websocket access domain name;
Path: Paths;
Main Options Description:
1, WebServer
(1) address or name of the destination server sent by server name or Ip:websocket
(2) port number the Port Number:websocker server listens on. (typically an HTTP 80 port, which can be obtained via Wireshark packets)
2. Timeout:
(1) connection– The maximum time, in milliseconds, that JMeter waits for a connection to complete after sending a connection request.
(2) Response-The maximum wait time for the response message.
3. WebSocket Request
(1) implementation– only supports RFC6455 (V13), the latest version of the WebSocket protocol standard.
(2) protocol– has WS and WSS, the WS prefix is the distinguished identity of the WebSocket connection, and the WSS prefix is the distinguished identity of the WebSocket secure connection. Fill in according to your actual situation
(3) Streaming connection– Select this TCP session to maintain, if the hook on the identity of the connection will always exist, if not checked, then the first response after the link will be closed.
(4) Request data: Fill in the requests to be sent, to communicate with the development of good, this is what format message.
4.WebSocket Response
(1) Response pattern– Sampler will wait for the message containing the identity and continue to communicate (or until timeout, the connection is closed)
(2) Close Connection pattern– If the message returned by the server contains such a character, it ends the session.
(3) Message backlog– defines the maximum length that the server returns message retention.
Step Three: Test
WebSocket pressure measurement using the JMeter