3.10.13. Replacing Test Cases in editors: Refactoring
Prev | 3.10. Working with editors: opening, adding/deleting/renaming items, commenting, adding descriptions, extracting and replacing, reverting changes | Next

### 3.10.13. Replacing Test Cases in editors: Refactoring

You can replace one or more Test Cases in an editor with another Test Case from your library of Test Cases. This is useful if you have created a module to replace one or more Test Cases and you want to be guided through the replacement process.

| To replace a specific Test Case at all / multiple places where it has been reused, use the option available in the Search Result View (Section 3.12.8, “Replacing a specific Test Case at places where it has been reused”).

1. Open the Test Case Editor or Test Suite Editor by double-clicking on the Test Case or Test Suite you want to edit.

2. Select the Test Cases you want to replace by single-clicking them. Use »CTRL« to select more than one item.

3. Right-click in the editor and select:

   Refactor-->Replace with Test Case.

4. The first page of a wizard appears in which you can replace selected the Test Cases in a series of steps.

| You may only replace single Test Cases which neither have multiple data sets nor central test data / Excel files as data.

Page 1: Replacing the Test Cases

1. On the first page of the wizard (Figure 3.18, “Select Test Case”), you can select a new Test Case to replace the selected Test Cases.

2. Browse to and select the Test Case you want to add to the editor.

3. Click ”Next” to match the component names for the old and new Test Cases, or click ”Finish” to replace the selected Test Cases with the bare new Test Case, without any component names transferred.

Figure 3.18. Select Test Case

Page 2: Matching component names

1. On the second page of the wizard (Figure 3.19, “Match component names”), you can see an overview of component names for the replacement.

   - On the left-hand side you can see any component names that were entered for the Test Cases to be replaced. If the component names were propagated (Section 3.15.5, “Propagating component names”), you will see a small yellow arrow on the component name icon.

     | If the old Test Cases contained no component names, then you will see the text no component names.

   - On the right-hand side, you can see the Component Names View, which shows any component names that are required by the new Test Case.

2. Use this dialog to transfer any component names from the old Test Cases to the new Test Cases. You can enter component names, or you can leave the new component names as they are. You can also set the checkbox in the Component Names View to propagate the name to the next Test Case in the hierarchy.

3. Once you have transferred the component names, you can click ”Next” to add further information or you can click ”Finish” to replace the selected Test Cases with the new Test Case and the selected component names.

Page 3: Further information

1. On the final page of the wizard, you can enter a Test Case reference name and a comment for the new Test Case.

2. Once you have entered a name and/or a comment, you can click ”Finish” to complete the replacement.

Once you have replaced the Test Case, you must manually adapt the parameters for the new Test Case.

Figure 3.19. Match component names