Rational Test Workbench - Examples
Note! Currently there is no trial download available (known to me). If you want to trail, contact Marc.
IBM.com Documentation developerWorks Getting Started
RIT RFT RPT Mobile

This page contains some examples of RTW usage.

Variable Passing

This paragraph will discuss examples of passing variables between RQM and RTW products.

RQM - RFT

  1. Define a variable in the Test Case/Test Suite. For example

    Figure: Execution variable defined in a Test Case

  2. Include following lines to use and log the value:
    IVariablesManager vm=getVariablesManager();
    IParameter _ButtonNumberRQM = vm.getInputParameter("ButtonNumberRQM");
    logInfo("Grabnumber ButtonNumberRQM: " + _ButtonNumberRQM.getValue() );
    

As documented you can not change a variable which is set by RQM. Which makes sense to me.

RFT - RFT

  1. The following lines creates a variable and sets a variable in RFT (name=ButtonNumberShare, value=_SetValueTo)
    IVariable myVar = vm.createOutputVariable("ButtonNumberShare", "Initial Value");
    vm.setOutputVariable(myVar);
    myVar.setValue(_SetValueTo);
    
  2. In a second test script (referenced by a Test Case), you can use the following lines to 'receive' the value again.
    IVariablesManager vm=getVariablesManager();
    IParameter _ButtonNumberShare = vm.getInputParameter("ButtonNumberShare");
    logInfo("Grabnumber ButtonNumberShare: " + _ButtonNumberShare.getValue() );
    
  3. Create a suite with the two test cases
    Make sure that the execution variables switch is activated.

RIT - RIT

Investigate Enterprise Tags.