WebSocket Request Item

WebSocket Request item makes a request for sending some data to the open WebSocket connection. Every WebSocket Request item is tied to the certain WebSocket Connect item.

You can change the tied Connect item for current Request item: click the Change button in item properties and select another Connect item in the displayed dialog:

WebSocket requests and responses may consist of several messages coming one after another. WAPT collects all messages of request/response to one message.

WebSocket Request items have all the necessary attributes for specification of one message being sent. Message body can be either text, or binary depending on the type of message. In case of binary type, message body is similar to the body of binary request. In both cases (text and binary) you can use variables.

When WAPT processes the received message, it first calculates the variables common for WebSocket Connect item. Then it calculates the variables of the last sent WebSocket Request item. If some function returns an error, you can keep an old value of variable. Check the option "Do not assign value, if any of the above functions returns an error" in the "Add Variable" dialog for this purpose:

User Interface of WebSocket Request Items

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

On the Properties tab you can specify the item name. Item type can be either Binary, Text, or JSON. Representation of data for sending is different for these types of items.

Here is an example of Binary item:

Text item:

JSON item:

Response processing tab of WebSocket Request items shows the list of variables and recorded messages. Variables are calculated after receiving a response to the current message.

Recorded Messages tab shows one sent message and all received messages (received before the next sending). This tab contains all information about the recorded message. For binary messages you can see their ASCII text representation.

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.

Next page