Splitting Actions in QTP

Share This Post -

You can split an action that is stored with your test into two sibling actions or into parent-child nested actions. When you split an action, the second action starts with the step that is selected when you perform the split action operation.

You cannot split an action, and the option is disabled when:

  • an external action is selected

  • the first step of an action is selected

  • you are working with a read-only test

  • recording a test

  • running a test

When you split an action in your test that uses a local object repository:

  • QTP makes a copy of the local object repository.

  • The two actions have identical local object repositories containing all of the objects that were in the original local object repository.

  • If you add objects to one of the split actions, the new objects are added only to the corresponding local object repository.

To split an action:

  1. Select the step before which you want the new (second) action to begin.

  2. Select Edit > Action > Split Action, click the Split Action button, or right-click the step and select Action > Split. The Split Action dialog box opens. Split Actions
  3. Select one of the following options:
    • Independent of each other. Splits the selected action into two sibling actions.

    • Nested (the second action is called by the first). Splits the selected action into a parent action whose last step calls the second, child action.

  4. If you want, modify the name and description of the two actions in the Name and Description boxes.

    Note: If a reusable action is called more than once in a test and you split the action into two independent actions, each call to the action within the test will be followed by a call to the new (reusable) action. If a reusable action is called from another test, however, splitting it may cause the calling test to fail.

  5. Go Back to: Working with Actions in QTP