Session data is an entity used to save session context information. Each test project has a single session data entity, located in the repository folder. New test projects are created with an empty Session Data entity which cannot be deleted. The Session Data entity enables defining variables and their types in the session context during design time. At runtime, a Session Data object is created for each session, and it is possible to set and then use the variables' values in the current session. When using these variables in Connection Pools, whenever a connection is returned to the pool, the Session Data is reset with the default values.
Note:
When executing a procedure using the Execute Procedure node, by default a
new session is created for the executed procedure, therefore a new session data
object is created for the executed procedure. To use the same session data
object as the procedure, map the session ID to the executed procedure ID.
The Session Data entity can be used in Test Case Procedure mappers.
To define variables and types of variables
Within the Repository node of the test project, double-click on SessionData. The Session Data entity is displayed.
Click
. An attribute is added to the Session Data.Provide a name for the attribute and a relevant description.
Select the type of attribute: Text, Long, Boolean, Double, Integer, Float, Byte or Date.
Determine if it is an array.
Enter a default value.
To set and use the variables
Setting and using the values is implemented by mapping to or from the session data variables (see Using the Mapper to Map Source Elements to Target Elements).
The following illustrates mapping from the Session Data to the Procedure's outputs.
The following illustrates mapping from the screen's field content to the Session Data
The following illustrates mapping from an Expression which uses the Session Data, to the Session Data.