Skip to end of metadata
Go to start of metadata

One effective way to boost reusability for large scale test cases libraries is to adopt a modular test case design approach. Instead of duplicating or copying and pasting test cases or steps, you should focus on breaking down them into smaller, reusable pieces and then recombines these tests to achieve larger end-to-end testing scenarios. The most valuable test cases are those which are broadly applicable and reusable across different cycles and releases. Being able to reuse test cases means test engineers should put some thought into how to design them so that they are as specific as they need to be while also being generic enough to be reused in different situations with different input data.

Testers can break down test cases into logical, manageable functions, or modules. These modules are isolated to create independent tests that can then be recombined or reused to make larger master test cases to achieve complex end-to-end testing scenarios. Parameterization can be introduced to create even more generic modules. In essence, parameters are used to unlock more flexibility when calling or invoking modules. Meanwhile reusing a module, the master test case can invoke a reusable module by passing a set of parameters, which can affect how input or output data are displayed or processed during the test execution. Eventually, parameters can contain default values, the tester should be able to change each one of the default parameters according to the context of the test at hand.

You can nest as many “child modules” called under any “master test case” as desired with multiple levels. Each set of steps will be unfolded during the test execution (with the parameter replaced) as displayed in the diagram below:

Notes

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

Creating a Test Case with Parameters

1. Open the desired Test Case and then click on Test Script.

2. Click on the dropdown and select Parameters.

3. In the parameters section, click on Add parameter and type the parameter name. Default value is optional.

4. In the step level you can make references to the parameters, just type curly brackets "}" to display the drop down and select the desired parameter. Each step will be unfolded during the test execution (with the parameter replaced with the values passed by the master test case).

You can drag and drop parameters on the Test Script tab to customize the order in which they appear.

Calling a Test Case with Parameters

1. Open the desired Test Case and then click on Test Script.

2. Click on "Call to test" to reuse the steps of the desired test case below the current step.

3. On the dialog, select one or more Test Cases to reuse their steps (you can also select Test Cases from any JIRA project).

4. The called test case is added below the current step

5. You can manually input the parameters (pass the parameters to the called test case) or use the default value from the called test case.

6. Optionally, you can create a test data table in the master test case and input the parameter by using the columns from this table. For each row of the parameters table a set of steps will be unfolded in the Test Player with the parameters replaced.

7. Optionally, you can create parameters in the master test case and input the called test case parameter with the master test case parameters. The steps will be unfolded in the Test Player with the parameters replaced.


  • No labels