WebSocket Connection Item

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

WebSocket Connection item has a unique name used for connection with the WebSocket Send Message items. In the following example you can see 3 "connect" items with their "send" items. The names of "send" items begin with the name of corresponding "connect" item. For example, a "connect" item "Connect WebSocket 01" has two "send" items tied to it: "Send WebSocket 01 Message 001" and "Send WebSocket 01 Message 002".

WebSocket connection consists of 2 phases:

Exchange of HTTP headers and version matching.
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.

User Interface of WebSocket Connection Items

Parameters of WebSocket Connection items are displayed on 3 tabs: Properties, Response processing and Close conditions.

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

2) Response processing tab contains settings for processing of incoming messages. In the list of variables 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.

3) On the Close conditions 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.

Note. If you delete a WebSocket Connection item, then all WebSocket Send Message 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 Send Message items are considered completed with errors.

Next page