Showing results for 
Search instead for 
Did you mean: 

Calling keyword Test

Occasional Contributor

Calling keyword Test

How to call keyword Test   in another script (both are script and keywordtest are in the same project)
Community Hero

RE: Calling keyword Test

Hi Saroj,

See the "KeywordTest.Run" and "Running Keyword Tests" help topics.



Running Tests From Scripts

You can run keyword tests from scripts. The statement that executes a test has the following syntax:

Call KeywordTests.Test_Name.Run(Param1, Param2, Param3 ...)

Here KeywordTests is the name of the project item. Test_Name stands for the name of the desired test.

Run is the method that is used to execute keyword tests. The method does not return any value.

Param1, Param2 and so on are values of the test parameters (if the test has parameters). You should specify the values for parameters in the same order, in which the parameters are displayed on the Parameters page of the KeywordTest Editor.

If the parameter has a default value, you may skip it in the call. If the parameter does not have a default value, it cannot be skipped.

If a test does not have parameters, just use the empty braces after the Run method name.


P.S. I would highly recommend to read TestComplete's help documentation - it is very useful and informative (unlike documentation for a lot of other tools by different vendors).

  /Alex [Community Hero]
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
New Here?
Join us and watch the welcome video:
Top Kudoed Authors