Applies to TestComplete 14.20, last modified on September 11, 2019

Description

The Project object provides a program interface to the properties of the current TestComplete project, to its test items and to the local variables defined in this project.

Members

Example

The following example demonstrates how to obtain the list of project test items and how to post the name of the currently running test item to the log.

JavaScript, JScript

function Test()
{

  var TestItems;
  …
  TestItems = Project.TestItems;
  Log.Message("The " + TestItems.Current.Name + " test item is currently running.");
  …

}

Python

def Test():
  # ...
  TestItems = Project.TestItems
  Log.Message("The " + TestItems.Current.Name + " test item is currently running.")
  # ...

VBScript

Sub Test

  Dim TestItems
  …
  Set TestItems = Project.TestItems
  Call Log.Message("The " & TestItems.Current.Name & " test item is currently running.")
  …

End Sub

DelphiScript

procedure Test();
var TestItems;
begin
  …
  TestItems := Project.TestItems;
  Log.Message('The ' + TestItems.Current.Name + ' test item is currently running.');
  …

end;

C++Script, C#Script

function Test()
{

  var TestItems;
  …
  TestItems = Project["TestItems"];
  Log["Message"]("The " + TestItems["Current"]["Name"] + " test item is currently running.");
  …

}

See Also

ProjectSuite Object

Highlight search results