Description
The KeywordTests
object provides access to keyword tests added to the Keyword Tests collection in your project in TestComplete:
The object provides access to individual tests added to the collection by their name as it is displayed in the Project Explorer panel:
Requirements
To access the KeywordTests
object in tests, you must have the Keyword Tests collection added to your project. See Adding and Removing Project Items and Their Child Elements.
Example
The code below shows how you can access and run a keyword test from a script test:
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
About Keyword Testing
Running Keyword Tests
KeywordTest Object