This topic describes how you can execute your script tests.
Run as test items
-
Open the Execution Plan editor of your project.
-
Add your script to the list of the project’s test items in one of the following ways:
-
Click New Test Item, then click the ellipsis button in the Execution entity of the added item and select your script in the resulting dialog.
-
Drag the unit that contains your script from the Project Explorer to the Execution Plan editor.
-
Drag you script from the Code Explorer panel (hidden by default).
-
-
Run the added test item or run the entire project (see Running Test Items). TestComplete will execute your script.
Run by tag or by tag expression
By one tag from the UI
-
Assign tags to your script. Tags.
-
Right-click your project in the Project Explorer and then click Run > Run @<Tag_Name>.
TestComplete will execute all the tests that match the selected tag.
By tag or by tag expression from Test Items
-
Assign tags to your script. See Tags.
-
Open the Execution Plan editor of your project.
-
Click New Test Item to add a test item to the test run sequence.
-
In the Execution entity column, click the ellipsis button. In the resulting Select Test dialog, in the Available Tests list, select the needed tag or select [Tag Expression].
Click OK to close the dialog.
-
If you have selected [Tag Expression], click the ellipsis button in the Parameters column and specify the needed expression in the Test Parameters dialog.
Close the dialog.
When you run your project or when you run the created test item, TestComplete will execute all the tests that match the specified tag or tag expression.
Run from Code Editor
Right-click anywhere within the script code and then click Run This Routine.
You cannot run a script in the described manner if it has parameters. To learn how to parameterize scripts, see Parameterizing Script Routines.
Run from other tests
From scripts
Call your script from another script function or procedure.
To call a script declared in another unit, first import that unit. See Calling Routines.
From keyword tests
-
Add the Run Script Routine or the Run Test operation to your keyword test.
-
Select your script in the resulting Select Test dialog.
-
If your script test takes parameters, specify parameter values in the resulting dialog.
Run your keyword test. It will execute the specified script.