KeywordTest object provides a scripting interface to keyword tests added to the Keyword Tests collection of your TestComplete project:
To get the
KeywordTest object in tests, use the following syntax:
KeywordTestsis the predefined name of the top-level object that provides access to a collection of keyword tests. To access the object, you must have the Keyword Tests collection added to your project. See Adding and Removing Project Items and Their Child Elements.
KeywordTest_Nameis the name of the keyword test that is added to the Keyword Tests collection of your project. You can view the name in the Project Explorer panel.
KeywordTest object has properties you can use to access its variables and parameters, and methods you can use to run your test.
The code below demonstrates how you can run a keyword test from your script.
var KeywordTestObj = KeywordTests.Keyword_Driven_Test_Name.Run();
KeywordTestObj = KeywordTests.Keyword_Driven_Test_Name.Run()
Set KeywordTestObj = KeywordTests.Keyword_Driven_Test_Name.Run()
KeywordTestObj : OleVariant;
KeywordTestObj := KeywordTests.Keyword_Driven_Test_Name.Run;
var KeywordTestObj = KeywordTests["Keyword_Driven_Test_Name"]["Run"]();