Forum Discussion

mailtosarojjena's avatar
Occasional Contributor
15 years ago

Calling keyword Test

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

1 Reply

  • AlexKaras's avatar
    Champion Level 3
    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).