WebSocket Connect Item


WebSocket connection consists of 2 phases:

  1. Exchange of HTTP headers and version matching.
  2. Transfer of any data in the binary format via messages.

After the first phase WAPT processes only cookies. Variables are processed on the second phase.

WebSocket Connect item makes a request for opening a WebSocket connection. This item has all the necessary attributes to set a connection.

WebSocket Connect item has a unique name used for connection with the WebSocket Request items. In the following example you can see 2 Connect items with their Request items. The names of Request items begin with the name of corresponding Connect item. For example, a Connect item "websocket_1 connect" has two Request items tied to it: "websocket_1 request_1" and "websocket_1 request_2".

User Interface of WebSocket Connect Items


Parameters of WebSocket Connect items are displayed on 2 tabs: Properties and Response processing.

The Properties tab is identical to usual HTTP requests (see WAPT help topics for more information).

On the Response processing tab you can specify one or several conditions to close the WebSocket connection:



Current session is completed: Connection will be closed when the current session is completed.
The number of received messages reaches _ : Connection will be closed when the number of received messages reaches a number specified here.
Total data received exceeds _ kilobytes: Connection will be closed when the total size of received data exceeds the number of kilobytes specified here.
Duration exceeds _ seconds: Connection will be closed when its duration exceeds the time value specified here.

If you check several conditions in this list, then connection will be closed when any of these conditions is fulfilled.

Below the conditions for closing WebSocket connection there is the list of variables. There you can see variables common for all messages.

Request Header, Request Body and Response Header tabs are similar to usual HTTP requests.

Recorded Messages tab shows the sequences of incoming and outgoing messages.

Received messages are shown on the green background .

Sent messages are shown on the blue background .

Messages of the same type going one after another are shown with different tones of the same color.



Note. If you delete a WebSocket Connect item, then all WebSocket Request items tied to it will be also removed.

CLOSE events


If during the test run WAPT catches a CLOSE event from the server, it closes the WebSocket connection. The client cannot close WebSocket connection during the test run.

If the client closes WebSocket connection during recording, it is not shown in the profile.

Processing of errors and connection breaks


If WebSocket Connection was closed either by the server, or by the client, WAPT does not re-connect. All subsequent WebSocket Request items are considered completed with errors.

Next page