IBM® Engineering Test Management execution variables
If you use IBM® Engineering Test Management to run functional test scripts, you can create variables for parameters within a functional test script that is associated with a Engineering Test Management test suite, test case, or test script. These variables, known as execution variables, can be passed to the functional test script to be used during playback.
When the Engineering Test Management test case is run, the execution variables that have been created are obtained by the functional test adapter and passed to the functional test script to be used on playback. Values for the execution variables can be supplied from the command-line prompt, a text file or worksheet, or from the associated test suite, test case, or test script. The details of the execution variables that are passed to the functional test script are displayed on the Execution Variable tab on the Execution Results page in Engineering Test Management.
For example, to log values for data such as user name and password in a functional test script, you can create variables for user name and password, either in Engineering Test Management or in the functional test script. When the associated test case is run in Engineering Test Management, the functional test adapter obtains the user name and password variables and provides them to the functional test script on playback. Values for the user name and password execution variables can be specified at the command line prompt, in a comma-separated values (CSV) file or text file. The values can also be specified in the associated test suite, test case or test script. Details of the user name and password variables are displayed on the Execution Variable tab on the Execution Results page in Engineering Test Management. The values for user name and password are displayed in the log.
Reading variables
When a Engineering Test Management test case or test script is run, the functional test adapter reads the execution variables that were created for the test case or script and passes the variables to the functional test script playback engine. The functional test playback engine provides the variables to the functional test script that is associated with the Engineering Test Management test case or script. On playback, the functional test script uses the variables and obtains values for the variables.
IVariablesManager vm=getVariablesManager()
IParameter name = vm.getInputParameter("name")
Creating variables
You can create execution variables within the associated functional test script.
IVariable <var name> = vm.createOutputVariable("<var name>", "<var value>");
Modifying variables
<var name>.setValue("<new var value>");
vm.setOutputVariable(<var name>);
Test cases in a test suite
For test cases in a test suite, the functional test output variables for a test case, if any, are provided as input variables for the next test case in the suite.
Rational® Functional Tester in stand-alone mode
When Rational® Functional Tester is in stand-alone mode without Engineering Test Management, the execution variables can be read from the command line, or from a text file or worksheet.
<playbackcmd> -var "username=user1;password=pass1"
<playbackcmd> -varfile <file containing values>
In
the text file or worksheet, each variable name and value pair must be on a new line. If
comma -separated values are provided, they are treated as a single value.