Using Persistent Variables
If you need to store variables between tests, use persistent variables. PTF stores persistent variables to the database so that subsequent test executions can use them.
Persistent variables are stored in the database keyed by execution option name. Persistent variables can also be keyed by User ID, machine name, or both.
There are two key elements required to use persistent variables:
Set the variable action in the test.
Set persistent variable options.
To set the variable option in the test, use the Test Property icon.
Create a new test or open an existing test.
Click on the Test Properties icon.
Field or Control
The test properties icon is located in the Test information group box.
Set the Variable Action field.
None (default). The test will not use persistent variables. All variables set in the test are only global to the current test execution.
Read. The test can only read persistent variables from existing persistent variables in the PTF test database.
The test can only write persistent variables to the PTF test database.
Read & Write. The test can read and write persistent variables from and to the PTF test database.
Use the Manage Persistent Variables page (PSPTTSTPERVAR) to modify or delete persistent variables.
This page will list all the persistent variables stored in the database. The variable is stored when the test writes the variable to the database.
The variable is always stored with the name of the execution option. The User ID and Machine Name are dependent on the selection you made for the persistent variable on the Advanced Options page of the Execution Options.
You can delete persistent variables or modify the variable value.
This example shows a test where the variable action was set to Read & Write in the Test Properties. The variable &userid exists in the persistent variable table.