Rational Quality Manager execution variables

If you use IBM® Rational® Quality Manager to run functional test scripts, you can create variables for parameters within a functional test script that is associated with a Rational Quality Manager 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 Rational Quality Manager 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 Rational Quality Manager.

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 Rational Quality Manager or in the functional test script. When the associated test case is run in Rational Quality Manager, 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 Rational Quality Manager. The values for user name and password are displayed in the log.

Note: By using execution variables, you can pass parameters at the test script, test case or test suite levels. To pass details only to a specific script, you can also use arguments to the testMain() method in the script. For more information, see Rational Quality Manager script arguments.
Note: The execution variables feature is available only with Rational Quality Manager, version 3.0.1. You can access the information center for Rational Quality Manager, version 3.0.1 at http://www.ibm.com/support/knowledgecenter/SSYMRC_3.0.1/com.ibm.rational.clm.doc/helpindex_clm.html .

Reading variables

When a Rational Quality Manager 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 Rational Quality Manager test case or script. On playback, the functional test script uses the variables and obtains values for the variables.

You must modify the functional test script to enable it to read the Rational Quality Manager execution variables during playback. This code is provided in the IVariablesManager API:
IVariablesManager vm=getVariablesManager()
You must modify functional test script to enable it to read the parameter names for the Rational Quality Manager execution variables during playback. This code is provided in the IParameter API:
IParameter name = vm.getInputParameter("name")

Creating variables

You can create execution variables within the associated functional test script.

To create execution variables within the functional test script, this code is provided in the IVariablesManager API:
IVariable <var name> = vm.createOutputVariable("<var name>", "<var value>");

Modifying variables

You can modify execution variables created in Rational Quality Manager either in the test suite, test case, or test script. You can modify execution variables created in the functional test script.
Note: Execution variables created in Rational Quality Manager cannot be modified in the functional test script, but can only be read.
To modify execution variables that were created earlier in the functional test script, this code is provided in the IVariable API and the IVariablesManager API:
<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 Rational Quality Manager, the execution variables can be read from the command line, or from a text file or worksheet.

Use a -var extension to enable Rational Functional Tester to read execution variables and their values from the command line. For example, type:
<playbackcmd> -var "username=user1;password=pass1"
Use the -varfile extension to enable Rational Functional Tester to read execution variables and their values from a text file or worksheet, for example:
<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.

Feedback