KeywordTests Object

Applies to TestComplete 15.70, last modified on December 17, 2024

Description

The KeywordTests object provides access to keyword tests added to the Keyword Tests collection in your project in TestComplete:

The Keyword Tests collection and keyword tests

The object provides access to individual tests added to the collection by their name as it is displayed in the Project Explorer panel:

KeywordTests.KeywordTest_Name

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
Keyword Tests
Running Keyword Tests
KeywordTest Object

Highlight search results