On the Test Items page of the project editor, you can view and change the project’s test run order. To open the Test Items page, do any of the following:
-
Select View > Organize Tests from the TestComplete main menu.
-
Double-click the project node in the Project Explorer and open the project editor and then switch to the Test Items page.
-
Select your project in the Project Explorer and click
Organize Tests on the panel’s toolbar.
-
Right-click your project in the Project Explorer and select Edit > Test Items from the context menu.
Test Item Parameters
The Test Items page shows the project’s test run order. Test items are any project items that can be run: keyword tests, script routines, low-level procedures, unit tests and so on.
You can organize test items into a plain list, grouped list or a tree-like structure (where child items are run after the parent item has finished running). You can exclude test items from or include them in the test run using the check box next to the test item name.
The following table contains descriptions of test item parameters.
Note: | Test item parameters are not applied if the test is launched from the Project Explorer or is called from another test (that is, if it is not run as a test item). |
Column | Description | ||
---|---|---|---|
Name | The test item name. | ||
Test | The test to be run - a keyword test, script routine, low-level procedure, network suite and so on. To choose a test, click the ellipsis button and use the resulting Select Test dialog. | ||
Count | The number of times the test will be repeated. Default is 1. | ||
Timeout | The maximum run time (in minutes) for the test item. If the run time exceeds the timeout, TestComplete posts an error to the test log and generates the OnTimeout event. You can create a handler for this event to stop the current test item and proceed to the next one. See Stopping Tests on Timeout.
Default is 0, which means no timeout. |
||
Parameters | Parameter values for the test (only for keyword tests and script routines). To specify parameter values, press the ellipsis button and use the resulting Test Parameters dialog. You can specify either hard-coded parameter values, or project variables. | ||
Stop on error |
If the project’s Stop on error option is disabled, this option specifies what to do if a test engine error (such as “object not found”) occurs during the test item run:
For more information on using the Stop on error option, see Stopping Tests on Errors and Exceptions - Overview.
|
||
Stop on exception |
If the project’s Error dialog option is disabled, this option specifies what to do if an unhandled script engine exception occurs during the test item run. Some examples of these exceptions are: invalid function name, invalid parameter value and so on.
For more information on using this option, see Stopping Tests on Errors and Exceptions - Overview.
|
||
Description | An arbitrary description of the test item. |
You can customize the column layout. For example, you can reorder or hide some columns. For more information, see Arranging Columns, Lines and Panels.
Working With the Page
To modify test item properties
To copy an existing test item or group
To include or exclude test items from a test run
To change the run order of test items
To navigate to the test source
To expand or collapse test items
To add a new test item
You can add a new top-level test item at the end of the test items hierarchy or add a new item as a child of the selected item.
You can add top-level test items in one of the following ways:
-
Click
New Test Item on the toolbar.
-
Right-click somewhere within the Test Items page and choose
New Item from the context menu.
-
Drag the desired test (for instance, a keyword test, a unit test and so on) from the Project Explorer panel to the Test Items page.
Note: If you drag and drop a script unit, TestComplete will add test items corresponding to all of the script routines contained in that unit. -
Drag a script routine from the Code Explorer panel to the Test Items page.
To add a child test item, do any of the following:
-
Select the parent test item or group and click
New Child Test Item on the toolbar.
-
Right-click the parent test or group and choose
New Child Test Item from the context menu.
-
Drag the desired test from the Project Explorer or Code Explorer and drop it in the parent test item.
Once you have added a new test item, you can modify its properties and relocate it in the list.
To add a new group
You can add a new top-level group at the end of the test list or add a new subgroup as a child of the selected node.
To add a top-level group:
-
Click
Add New Group on the toolbar.
– or –
-
Right-click somewhere within the Test Items page and choose
New Group from the context menu.
To add a subgroup:
-
Select the parent test item or group and click
New Subgroup on the toolbar.
– or –
-
Right-click the parent test or group and choose
New Subgroup from the context menu.
To modify test item properties
-
Select the cell that contains the data you want to change, and press F2 or click twice (not double-click).
To change the test to be executed:
-
Click the ellipsis button of the Test column and choose the desired test using the Select Test dialog.
To modify the parameter values for the test:
-
Click the ellipsis button within the Parameters cell and use the resulting Test Parameters dialog.
To rename a group
-
Select the group and press F2, or click the group twice (not double click).
-
Enter the new name for the group and press Enter to apply it.
To copy an existing test item or group
-
Select the source test item or group and click
Copy on the Standard toolbar or press Ctrl+C.
-
Click
Paste on the Standard toolbar or press Ctrl+V.
– or –
-
Right-click the source test item or group and select Copy from the context menu.
-
Right-click somewhere within the Test Items page and choose Paste from the context menu.
Note: | Currently, you can copy test items and groups within the same project. You cannot copy an item from one project to another. |
To include or exclude test items from a test run
TestComplete allows you to easily specify which test items should participate in testing and which should be temporarily excluded.
To enable or disable a single test item or group:
-
Select or clear the check box next to the test item’s icon.
To enable or disable several test items at once:
-
Select the desired test items in the panel using Ctrl- and Shift-clicks.
-
Click the
Enable Selected or
Disable Selected button on the toolbar.
– or –
Right-click the selection and choose Enable\Disable > Enable Selected or Enable\Disable > Disable Selected from the context menu.
To enable or disable all of the test items:
-
Click the
Enable All or
Disable All button on the toolbar.
– or –
-
Right-click somewhere within the Test Items page and select Enable\Disable > Enable All and Enable\Disable > Disable All from the context menu.
To toggle the enabled property of all test items:
-
Click the
Toggle All button on the toolbar.
– or –
-
Right-click somewhere within the Test Items page and choose Enable\Disable > Toggle All from the context menu.
To run a test item or group
-
Select the desired test item or group of test items and click
Run Focused Item on the toolbar.
– or –
-
Right-click the test item or group and select
Run Focused Item from the context menu.
TestComplete will run the selected test item or group along with all child items.
Note: | Only enabled test items can be run. |
To change the run order of test items
-
Use the
Move Up,
Move Down,
Indent Item and
Outdent Item buttons on the toolbar.
– or –
-
Drag the desired item to the desired location within the tree. When you drop the dragged item, TestComplete will place it after the test item that is under the mouse cursor.
Note: To move an existing test item to a group, press Alt and drag the test item to the group.
To navigate to the test source
-
Select the test item and click the
Jump To Test button on the toolbar.
-
Right-click the test item and select Jump To Test from the context menu.
TestComplete will open the corresponding editor in the Workspace panel. If the test item relates to a certain scripting routine, TestComplete will navigate to the beginning of the routine in the Code Editor.
To expand or collapse test items
To expand all test items on the Test Items page:
- Right-click somewhere within the Test Items page and select
Expand All from the context menu. Alternatively, use the Ctrl+Alt+A shortcut.
To collapse all test items on the Test Items page:
- Right-click somewhere within the Test Items page and select
Collapse All from the context menu. Alternatively, use the Ctrl+Alt+C shortcut.
To delete a test item or group
-
Select the desired node in the list (you can use Ctrl- or Shift-click for multiselection).
-
Press DEL, or click
Delete on the Standard toolbar, or choose
Delete from the context menu.
To save or cancel changes
To save changes made to the project’s test items, select File > Save from the TestComplete main menu.
To cancel any changes, close the editor and answer No when TestComplete asks you whether to save the changes.
See Also
Projects in TestComplete
Tests and Test Items
Running, Pausing and Stopping Automated Tests
Stopping Tests on Timeout