Processing of Variables


WebSocket connection consists of 2 phases:

Exchange of HTTP headers and establishing a WebSocket connection.
Transfer of any data in the format of WebSocket protocol over an open connection.

Variables are calculated on the second phase.

Note that both types of items: WebSocket Connection and WebSocket Send Message may have variables. They are listed on item's Response processing tab:



However, the processing of variables is different for "connect" and "send" items.

When WAPT processes the received message, it first calculates variables of WebSocket Connection item. These variables are common for all messages received from the server over the current connection. They are calculated for every received message. After processing of these variables, WAPT calculates variables of the last sent WebSocket Send Message item. These variables are processed until this "send" item is the last sent item in the current connection. As soon as the next "send" item is sent, WAPT starts processing of variables of that item.

So, WAPT processes variables defined in WebSocket Connection item and in the last sent WebSocket Send Message item.

The order of processing of variables: first WAPT calculates variables of WebSocket Connection item, then variables of the last sent WebSocket Send Message item.

We recommend to avoid using the same names for variables of "connect" and "send" items, because their values may be overwritten and it will lead to incorrect test results.

Next page