Parameters

Using parameters and adopting a modular approach to test case design effectively enhances reusability in large test-case libraries. The most valuable test cases are broadly applicable and reusable across various cycles and releases. To maximize reuse, test engineers should design them to be as specific as necessary and as generic as possible, allowing use in different situations with different data inputs. Instead of duplicating or copy/pasting test cases or steps, break them into small, reusable components to enable assembly into larger end-to-end testing scenarios.

Testers can break down test cases into logical, manageable functions or modules. These isolated modules can be used to create independent tests and reassembled to create larger end-to-end test cases. Parameters add more flexibility to make your modules even more versatile and reusable. They can include editable default values that help testers adapt to different testing scenarios. When calling a reusable module that has parameters, the main test case provides these parameters, which can influence how input or output data are shown or handled during testing.

You can nest as many child modules under any main test case as needed, with multiple levels. Each set of steps unfolds during test execution (with the parameter replaced), as shown in the following diagram.

64107e2371683.png

Creating Test Case Parameters

You can easily create test case parameters by following the given steps.

  1. Navigate to the Test Script tab of your test case and ensure the Type is set to Step-by-Step.

    Zephyr_Parameters_1.png
  2. Locate the Data Type drop-down list on the right-hand side of the screen and select Parameters to enable the use of test case parameters.

  3. In the Parameters section, click + Add Parameter and enter a name for the parameter in the Parameter Name field.

    Optionally, add a default value for the parameter in the Default Value field.

    Zephyr_Parameters_2.png
  4. Click Save to confirm your changes. You can reorder parameters by dragging and dropping them within the Parameters section.

  5. In the Steps section, click into the Test Data or Expected Result fields for a step. Type a curly brace { to display the list of available parameters and select the desired parameter from the drop-down list.

  6. During test execution, the parameters will dynamically populate with the specified values, either from the Default Value field or from manually provided input.

Calling a Test Case with Parameters

  1. Navigate to the Test Script tab of your test case.

  2. In the Steps section, click Add 'Call to test' step below to reuse the steps of the desired test case below the current step.

    Zephyr_Parameters_3.png
  3. Select one or more test cases to reuse the steps. Note that you can select test cases from any Jira project.

  4. Click Add. The test case that was called is added below the step from which it was called. You can add manual inputs for parameters on the called test case or use the default value.

  5. The steps unfold in the Test Player during test execution, and the parameters are replaced with the values from the main test case.

  6. Calls to test are links to the source test-case steps. If you make changes to the source steps, those changes will replicate automatically.

Publication date: