Using Parameters Passed From a Visual Test in Another Visual Test

Once input and output parameters have been defined for a visual test, the output parameters can be passed during playback to another visual test that executes the initial visual test. However, to use the passed parameters in the other visual test, they must be set to local variables that are stored in the visual test.

  1. Open the visual test.
  2. In the Test Steps pane, select the step in the visual test that executes the embedded visual test. The step text looks similar to Playback visual test 'asset name', where 'asset name' is the name of the inserted visual test.
  3. In the Properties pane for the step, expand the Output parameters category. The names of variables defined as output parameters to be passed from the embedded visual test to the embdedding visual test appear in the Output parameters subcategories. These parameters must now be set to local variables created for the embedding visual test. If the parameters do not appear in the Properties pane, reload the embedded visual test. To do this, in the Properties pane of the embedded visual test step, click the Name text box, and then click Update Parameter Names.
  4. Click the text box of an output parameter name in the Properties pane and select the appropriate local variable from the list. This sets the value of the parameter passed from the embedded visual test to a local variable in the embedding visual test so it can be used in the embedding visual test.
  5. Repeat the preceding step for each output parameter in the Properties pane to be passed to from the embedded visual test to the embedding visual test.
    Note: To see the values passed from the embedded visual test to an embedding visual test, insert result comment steps into the embedding visual test. For the comment Expression property, click Select and then choose Variable. Select a local variable from the list that contains the passed value.
  6. In the embedding visual test, modify the appropriate test step to include the local variable. The local variable passes the data from the output parameter of the embedded visual test to the test step in the embedding visual test.
    1. Select the step that you want to use in the Test Steps pane.
    2. In the Properties pane, click the text box for the property that corresponds with the local variable property type. For example, you might click the text text box in the Parameters category.
    3. Click the Select button, and then select Variable. The Select a Variable dialog box opens.
    4. Select the local variable that you want to use, and then click OK. The step text displays as: Enter '[localvariablename]'.
If the embedded visual test has been included for playback in the embedding visual test and its input and output parameters have been defined correctly, the embedded visual test can now be played back and parameters are successfully passed between the embedding visual test and the embedded visual test.
Note: For a detailed example of how to create input and output parameters and use them in a visual test, refer to Playing Back Scripts From Visual Tests in the Welcome to the SilkTest Workbench Visual Test Tutorial.