TestComplete Project Test Items

October 7, 2013

In Testcomplete the Test Items page within your project is used to organize, manage & execute the test cases that you’ve automated. For example we might have developed test automation scripts for thousands of test cases. However, each time we want to create a software test automation run we may want to execute only a selection of the testcases. We may also want to execute some multiple times with different test data. The Test Items feature allows us to perform all of these tasks simply.

  1. Organise Testcases
  2. Execute only selected Testcases.
  3. Execute a testcase multiple times
  4. Executing a testcase with different test data

A blank Test Items page will look like this:

TestItems

So lets work with this and consider the following software automation script.

automation-test-script

This TestComplete project has keyword and script routines. Let us say each keyword test represents a different testcase. Also each method in Unit1 is a testcase. As shown in the image the script routine ‘Test4’ requires two parameters (name and age) in order to be executed.

If we add every method & keyword test as a Test Item, we can easily execute the required test cases alone. You can see this in the image below.

run-the scripts

If we click the Run button this will execute only the selected Items. We can add any type of Test items (Script routines, Keyword Test, Load Test, Low level script unit etc) here in order to execute the items in the desired order. Also, if we need to we can pass parameters between the items we’re executing.

Before we look at passing parameters lets see how we can add a Test Item.

  1. Open the Test Items page of the Project. To do this,
    • Double Click on Project Folder in the Project Explorer panel.
    • double-click-project-folder

    • It will open the project Editor window. Click on the Test Items option which is available at the bottom.
    • tes-project-folder-select

  2. Click on ‘New Test Item’ button. It will add a New Test Item row.
  3. New-Test-Item

  4. In the Name column of the New Test Item row, enter a name for this Test Item.
  5. enter-name-test-item

  6. In the Test column, select the Test item to be executed. A Test item may be a script routine or keyword test etc. To select a Test item do the following steps.
    • Click on the ellipse button in Test column.
    • select-test-column

    • It will open Select Test window. Here select a Script routine or Key word test and click OK button. (Here we select the script routine Test4)
    • Select-new-Test

    • Now in the Test column it will show the selected Test item.
    • selected-test-routine-displayed

  7. In the Count column enter the number of times the Test item is to be executed.For example If we enter 3, this Test item will be executed 3 times. For now let us keep the value as 1.
  8. enter-number0of0itens-test-execution

  9. The Timeout column shows the maximum execution time allowed for that particular Test Item. If we set this value as 20, after 20 minutes if the execution of the test item is not finished, it stops executing this test item and moves to next Test item.
  10. set-time-out

  11. In the Parameters column, you can set the values for the parameter of that Test item.
    • If the Test Item has no parameter, the value will be displayed as [none]
    • Parameters

    • If the Test Item has any parameters, we should pass values for those parameters. To pass values do the following.
      • Click on the ellipse button in parameters column.
      • Test-Parameters-window

      • It will open Test Parameters window. This window will show the list of parameters available for that Test Item.
      • test-Parameters-window1

      • For each parameter select the value Type and Enter (or select) the Value. Then Click OK button.
      • select-type-and-value-in-test-parameter

  12. In the Description column, enter a description for this Test Item.
  13. enter-description-value

Now we have added a Test Item. The Check box in the Name Column is used to enable or disable the Test Item. If it is not checked, the Test Item will not be executed.

enable-disable-test-item

With this, we can add the Test items we need and organise our test execution. All this without having to modify any of our coded scripts or our keyword tests. This approach to structuring your automation delivers a level of flexibility that makes organising your testing far simpler.