IBM Support

How to pass tag values using the Run Test action

Question & Answer


Question

How do you pass tag values between parent test and child tests in Rational Integration Tester (RIT) of IBM Rational Test Workbench (RTW)?

Cause

You want to structure your tests so that you call sub-tests by using the Run Test action. You want to know how you can pass values between the tests by using tags.

Answer

See the Rational Integration Tester Reference Guide for full details on the use of test tags.

The following is a worked example to demonstrate the use of tags to pass values between tests. It passes a value from parent to child test, and from child to parent test. A small sample project containing this example is also attached for you to try.
 

  1. Create the parent test.
     
  2. Create a test tag in the parent test in the Tag Data Store to pass a value in to the child test.



    Enter a Default Value that you pass into the child test.

    Click Expose as output to enable the value that you pass to other tests.

    Note that the setting for Confine scope to this test controls whether other tests use the tag value. This setting is only relevant when this test is part of a test suite. It has no effect here.
     
  3. Create a test tag to store the value returned by the child test.



    Click Expose as input. to allow the tag to get a value from a child test value.

    Enter a Default Value.
     
  4. Create the child test.
     
  5. Create a tag In the child test to pass a value back to the parent test.
    Click Expose as output.


     
  6. Create a tag in the child test to store the value from the parent test.
    Click Expose as input.


     
  7. Add a Run Test action in the parent test and highlight the child test.
     
  8. Click the Value tab and highlight the child test tag.



    Click the button highlighted to move the tag from Unmapped to Mapped. Now you can map a value to that tag.


    Highlight the tag and enter a value in the Value field or right-click to select the parent tag that you want to pass in.

    image 1618

    Click OK to save.
     
  9. Click the Store tab to get a value from the child test.

    Highlight the tag and click the button to move the tag from Unmapped to Mapped.

    Highlight the tag in Mapped and right-click in the Value field to select the child test tag.




    This configuration will map the value held in child test tag child_value to the parent tag my_tag.
     
  10. Add some Log steps in both parent and child test to display the values of the tags to confirm that you are mapping the values correctly.
 

NOTES

  • If you click Run process in parallel in the Config tab of the Run Test action you will not be able to pass values from the child test back to the parent test. This is because the child test is running asynchronously from the parent.
  • Click on the Properties tab of a test in the test editor to see a summary of tags being used for input and output.
  • You can share tag values between tests in the same test suite.
    Create the same tag in each test and disable Confine scope to this test.
    The tag value will be passed to each subsequent test.

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSBLQQ","label":"IBM Rational Test Workbench"},"Component":"Rational Integration Tester","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
25 September 2019

UID

swg21620170