Current Property (Specific to ProjectSuite Object)

Applies to TestComplete 14.92, last modified on September 16, 2021

Description

Use the TestItems.Current property to obtain the project suite’s test item which is currently running.

If test items are not running (for example, you started a script routine or a keyword test manually from the Code Editor or from the Keyword Test editor), Current returns an “empty” value (Nothing in VBScript, null in JavaScript, JScript, C++Script and C#Script, None in Python, nil in DelphiScript).

For more information about the project suite’s test items, see Test Items Page.

Declaration

ProjectSuite TestItemsObj.Current

Read-Only Property A TestItem object
ProjectSuite TestItemsObj An expression, variable or parameter that specifies a reference to a ProjectSuite TestItems object

Applies To

The property is applied to the following object:

Property Value

The TestItem object corresponding to the currently running project suite’s test item.

Example

The following code snippet obtains a project suite’s test item which is currently running and posts its name to the test log.

JavaScript, JScript

function Test()
{

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

}

Python

def Test():
  TestItems = ProjectSuite.TestItems
  Log.Message("The " + TestItems.Current.ProjectName + " test item is currently running.")

VBScript

Sub Test

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

End Sub

DelphiScript

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

end;

C++Script, C#Script

function Test()
{

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

}

See Also

Test Items Page
ItemCount Property (Specific to ProjectSuite Object)
TestItem Property (Specific to ProjectSuite Object)

Highlight search results