Parameters

Using parameters and adopting a modular approach to test case design is an effective way to boost reusability for large test-case libraries.

The most valuable test cases are broadly applicable and reusable across different cycles and releases. To effectively reuse test cases, test engineers must design them to be only as specific as required and generic enough to be reused in different situations with different data inputs. Instead of duplicating or copy/pasting test cases or steps, break them down into small, reusable pieces to give yourself the ability to assemble them 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 they can be reassembled to create larger end-to-end test cases.

Parameters provide additional flexibility to make your modules even more generic and reusable. They can contain editable default values that allow testers to meet the needs of various testing situations. When invoking a reusable module that contains parameters, the main test case passes the parameters, which can affect how input or output data are displayed or processed during test execution.

You can nest as many child modules called under any main test case as desired and with multiple levels. Each set of steps unfolds during the test execution (with the parameter replaced) as displayed in the following diagram:

64107e2371683.png

Create Test Case Parameters

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

  2. Locate the Data Type dropdown menu 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.

  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 dropdown 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.

    Test-Case-Detail_Tab.png

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.

    Call-to-Test.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 called test case 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: