Session Data

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.

Start of instruction setTo define variables and types of variables

  1. Within the Repository node of the test project, double-click on SessionData. The Session Data entity is displayed.

    graphics/sessionData4.png

  2. Click Add Attribute. An attribute is added to the Session Data.

  3. Provide a name for the attribute and a relevant description.

  4. Select the type of attribute: Text, Long, Boolean, Double, Integer, Float, Byte or Date.

  5. Determine if it is an array.

  6. Enter a default value.

Start of instruction setTo set and use the variables

  1. 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.

    graphics/sessionData1.png

    The following illustrates mapping from the screen's field content to the Session Data

    graphics/sessionData2.png

    The following illustrates mapping from an Expression which uses the Session Data, to the Session Data.

    graphics/sessionData3.png