Using ECMAScript with tags in IBM Rational Integration Tester
How do you use tags with ECMAScript in the Function test action in the Rational Integration Tester (RIT) of IBM Rational Test Workbench and Green Hat Software GH Tester?
From GH Tester version 5.4 and RIT version 8.0, ECMAScript can be used within the Function test action. The use of tags has changed and this technote provides guidance and examples.
A drop-down box has been added to the Function action. The default is "ECMAScript" and you may also select "Legacy" for previous GH Tester functions.
All test tags are automatically defined as String variables in the ECMAScript function and may be directly referred to by name. Tags cannot be created in the Function step, they must already exist in the Tag Data Store of the test.
NOTE: Do not surround the tag name with %% symbols. Depending on the version, if you use the right-click context menu to add a tag it may include %%s; remove them.
For example, the
customerID tag is given a value as follows:
customerId = 4;
You can also access tags using tags syntax:
tags['customerID'] = 4;
This allows you to use tag names that are reserved words in ECMAScript.
If you write data to the tag variables inside the Function action, the values are saved into the test tags on exit and may be used in later test actions.
You can print the complete list of tags with their values to the test console with the following:
print( tags );
A sample project is attached that has several worked examples including the use of list tags and regular expressions.