Thursday, September 11, 2014

How to work with Reusable Test Cases ?

Reusable Test cases saves defining of test steps for same test action repeatedly. The purpose is to create the Test Case which you want to reuse. E.g. Login and Logout process in User registration business flow. Then explore the Test Case where you want to reuse the Test Case. & at last select the Test Case which you want to reuse in the Test Case Store tree.
Let us see step by step details-
Creating Test Parameters in a Design Step
    You can add a parameter to the description or expected results of a manual design step. You can use existing parameters, or define new parameters.
To insert a test parameter in a design step:
  1. In the Design Steps tab, double-click a design step. Place the cursor in the Description box or Expected Result box.
  2. Click the Insert Parameter button The Insert Parameter dialog box opens.
  1. To insert an existing parameter, select the parameter and click OK. The parameter is added to the step at the current cursor location, using the syntax <<<parameter name>>>.

Note: If you apply formatting to a parameter name in a design step, you must apply the same formatting to the entire parameter name, including the <<< and >>> characters. For example, if you want to italicize the parameter <<<password>>>, you must italicize the entire string <<<password>>> and not just the word password.
Designed test looks like –
imageNow the reusable test is defined.
In order to call this test for various steps in various test cases
  1. Click on Call to test as shown in below snap.
2. Select the reusable test from the test tree, as in below snap.
3. Once we click on Ok, Parameters to test window will open where we have to pass the values to the parameter defined.
4. Once all parameters to test are passed, it looks as below -

5. Click on Ok. That’s it, you have called the reusable test & passed values to the parameters.

No comments: