Adding input and output tags to tests
You can send input parameters to, and receive output parameters from the agent computers that are running the tests. You can also chain together multiple HCL OneTest™ API tests in Engineering Test Management so that the output of one test can be input into another test. To accomplish this task, create a simple test in Test Factory, and then expose HCL OneTest™ API test tags as input and output.
Procedure
- Click .
- Right-click Test Steps and select to insert a Function action.
- Double click the new function. The Function window opens.
- In the text pane, right-click and select . The Create Tag window opens.
- In Name, type outputtag and select the Expose as output check box.
- Click OK.
- In the Function window, in the text pane on the same line as tags["outputtag"], press the space bar, type an equals (=) sign, and press the space bar again.
- Right-click in the text pane and select .
- In Name, type inputtag and select the Expose as input check box
- Click OK.
- In the Function window, after tags["inputtag"], type a plus sign (+).
- Right-click next to the tag and select tags["outputtag"] = tags["inputtag"]+tags["TEST/START_TIME"]. Click OK. . The text should now read
- Add a log action as a new step to the test. Click the Log Action icon ( ) and then double-click the log. The Log window opens.
- In Output Message, type outputtag is.
- Right-click next to the text, and then select outputtag is %%outputtag%%. . The text for the output message reads
- Click OK.
-
When you run this test, the
inputtag
content is concatenated with the test time, and the result is saved to theoutputtag
variable. The test should look like this: Notice that the message that you defined displays in the test console output: