Lesson 5: Splitting actions in a test

You can learn about splitting the actions of a test into test segments with different nodes. If a test contains many actions, you can split the test to create multiple nodes with meaningful test segments. You can then perform various actions such as inserting a loop, inserting a condition, and so on to the test segments of the selected nodes. You can also move a node from the existing test to a new test, and add the new test to a compound test that consists of various other tests that can be run sequentially.

Before you begin

You must have completed the following tasks:

About this task

For the test scenario in this tutorial, you can split the actions that are related to logging in and searching into two different test segments. You can then group the actions related to searching and move them to a new test segment.

Procedure

  1. Select the actions from search to logout in the test that is displayed on the Test Contents panel.
  2. Right-click the selected actions, and then click Split UI actions.
    Image of the Test Content panel to Split UI actions

    The Refactoring test to split UI actions from current selection dialog is displayed with the changes that you performed as a result of the split.

    Image of Split UI Refactoring

  3. Click Finish.

    The In application node is displayed in the Test Contents panel, and the node contains all the actions that are split.

    Image of In application node

  4. Click File > New > New Test to create an empty test.
    The New Test dialog is displayed.
  5. Perform the following steps in the New Test dialog:
    1. Select myProj as the parent folder.
    2. Enter wiki-search-animals in the File name field, and then click Next.
    3. Optional: Enter Search for an animal's name as the description, and then click Next.
    4. Select the UI Test Feature checkbox, and then click Finish.
      A new test called wiki-search-animals is created and the Test Contents panel of the test is displayed.
  6. Right-click the In application node in the Test Contents panel of the wiki-search test, and then click Cut.
    Image of In application cut action

  7. Right-click the root node of the wiki-search-animals test, and then click Paste.
    The steps from the In application node of the wiki-search test are added to the wiki-search-animals test.
    Image of In application paste action

  8. Click File > Save.

Results

You have learned to split the actions of a test into multiple test segments with different nodes and move a node from the existing test to a new test.

What to do next

You can learn about creating a dataset to associate it with a Web UI test. See Lesson 6: Creating a dataset.