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 through an open connection.
Variables are calculated on the second phase.
Note that both types of items: WebSocket Connect and WebSocket Request may have variables.
They are listed on item's Response processing tab:
However, the processing of variables is different for Connect and Request items.
When WAPT processes the received message, it first calculates variables of
WebSocket Connect item. These variables
are common for all messages received from the server through the current connection. They are calculated for every received
message.
After processing these variables, WAPT
calculates variables of the last sent WebSocket Request item.
These variables are processed until this Request item is the last sent item in the current connection.
As soon as the next Request item is sent, WAPT starts processing the variables of that item.
So,
WAPT processes variables defined in WebSocket Connect item and in
the last sent WebSocket Request item.
The order of processing
the variables: first WAPT calculates variables of
WebSocket Connect item, then variables of the last sent WebSocket Request item.
We recommend to avoid using the same names for variables of Connect and Request items, because their values may be
overwritten and it will lead to incorrect test results.