Description
The 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:
-
KeywordTests
is 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_Name
is 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.
The KeywordTest
object has properties you can use to access its variables and parameters, and methods you can use to run your test.
Members
Example
The code below demonstrates how you can run a keyword test from your script.
JavaScript, JScript
var KeywordTestObj = KeywordTests.Keyword_Driven_Test_Name.Run();
Python
KeywordTestObj = KeywordTests.Keyword_Driven_Test_Name.Run()
VBScript
Set KeywordTestObj = KeywordTests.Keyword_Driven_Test_Name.Run()
DelphiScript
var
KeywordTestObj : OleVariant;
begin
KeywordTestObj := KeywordTests.Keyword_Driven_Test_Name.Run;
end;
C++Script, C#Script
var KeywordTestObj = KeywordTests["Keyword_Driven_Test_Name"]["Run"]();
See Also
Keyword Tests
Keyword Tests
Running Keyword Tests
KeywordTests Object