Mapping RQM Execution Variables to QTP parameters

Engineering Test Management has a capability to define execution variables at both test suite and test case level. Engineering Test Management has a capability to define execution variables at both test suite and test case level. In either case, the execution variable values are type-less; stored as ordinary text strings. On the other hand, QTP exposes variables with specific contextual meanings. Furthermore, the QTP variable values are described by data type attributes (number, date, text, etc.). Therefore, there is a transformation process that place where a Engineering Test Management execution variable is converted to the appropriate QTP variable. The transformation is done in the QTP adapter. The QTP adapter transforms execution variables to the following types of variables in QTP:

1. Environment variable
2. Test parameter

The QTP adapter distinguishes the QTP Variable type using a naming convention defined for execution variable names. The adapter detects a prefix on the execution variable names and matches that to the appropriate variables in QTP. The mapping of the execution variable takes place on taking the execution request from Rational Quality Manager, and before running the QTP script. The adapter sets the QTP variable values and then proceeds to invoke the script execution.

Defining Execution Variable:

1. The QTP adapter uses the following naming convention on execution variables to distinguish between QTP side environment variables and test parameters:

RQM Execution Variable (prefix_variableName) Treated as in QTP
tst_variableName E.g. tst_para1 Test parameter
env_variableName E.g. env_para1 Environment Variable
VariableName (with no prefix) E.g. para2 Environment Variable

2. The execution variable is passed as a string (text) to the QTP adapter. The Engineering Test Management user interface does not type-check when defining the execution parameter. Users must take care of entering valid values for the type defined in the respective QTP variables. The user should use appropriate value for them to match with the data type (number, date, text ) of corresponding QTP counterpart. Any mismatch in the data type will fail when the QTP adapter attempts to set the QTP parameter.

3. Open the execution variable tab in either test suite or test case and define all the required execution variables. Following image shows definition for some of the variables.

4. As shown in the image, tst_para1 and tst_para2 will be passed as test parameters while env_para1 and para2 will be passed as environment variable to the corresponding QTP script.

5. The Adapter will attempt to match execution variable with corresponding test/environment parameters in QTP. If it doesn't find a match then it will strip off the prefix (tst, env) from the execution variable and re-attempt to update the QTP parameters. In case the adapter fails to find a matching QTP parameter , it will log a warning in the output file.

6. The execution variables can be defined at the test suite level as well and will be passed with each execution request. All the steps mentioned above holds true for them as well. When same name is used to define execution variable at both test suite and test case level, the one at test suite will be passed to the adapter.

Defining QTP Parameters:

1. To set/edit the test parameters in a QTP script go to File->Settings->Test Settings->Parameters

2. To create/edit the environment variables in a QTP script go to File->Settings->Test Settings->Environment

3. The action parameters are internal to a QTP script and can be mapped with environment variables or test parameters which can be passed from outside to the script

4. Create/edit the action parameters using the action properties window.

5. Map the action parameters to either test parameter or environment variable using Action call properties window.