Parameters

Using parameters and adopting a modular approach to test case design is an effective way to boost reusability for large test cases 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 main test cases.

Parameters provide additional flexibility to make your modules even more generic and reusable. They can contain editable default values which allow testers to meet the needs of various testing situations. When invoking a reuseable 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:

parameters-01.png

Note

You cannot enable both Test Data and Parameters at the same time.

Create Test Case Parameters

Begin with either a new or existing test case.

Note

You can drag and drop parameters in the Parameters section (on the Test Script tab) to adjust the order in which they appear.

  1. Click the Test Script tab.

  2. Ensure the Type is Step-by-Step.

  3. Click the dropdown, then click Parameters. The Parameters section appears.

    test-case-parameters-dropdowns-svr.png
  4. Click Add Parameter and type the parameter’s name. The Default Value field is optional.

    test-case-parameter-add-svr.png
  5. In the Steps section, type a brace, sometimes called a curly bracket, to display the list of parameters you’ve created.

    create-test-case-parameter-entry-svr.png
  6. Reference the desired parameter for the step by selecting it from the dropdown list.

    Each step unfolds during the test execution, and the parameters are replaced with the values from the main test case.

Call a Test Case with Parameters

Begin with either a new or existing test case.

Tip

You can add manual inputs for parameters on the called test case or use the default values.

manual-input.png
  1. Click the Test Script tab.

  2. Click Call to Test to reuse the steps of the desired test case below the current step. The Add Existing Test Cases dialog opens.

    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.

    create-test-case.png

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

test-script-call-to-test.png

Note

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: