TestedApps.Count Property

Applies to TestComplete 15.42, last modified on September 08, 2022

Description

The TestedApps.Count property lets you get the total number of items (TestedApp objects) that belong to the current project's list of applications to be tested.

Declaration

TestedApps.Count

Read-Only Property Integer

Applies To

The property is applied to the following object:

Property Value

The integer that means the number of items in the application list.

Example

The following script posts a list of the project’s tested applications to the test log.

JavaScript, JScript

function Test()
{
  if (TestedApps.Count > 0)
  {
    Log.Message("The project contains the following tested applications:");

    for (var i = 0; i < TestedApps.Count; i++)
      Log.Message(TestedApps.Items(i).ItemName);
  }
  else
    Log.Message("The project does not contain tested applications.");
}

Python

def Test():
  Count = TestedApps.Count
  if TestedApps.Count > 0:
    Log.Message("The project contains the following tested applications:")
    for i in range(0, Count):
      Log.Message(TestedApps.Items[i].ItemName)
  else:
    Log.Message("The project does not contain tested applications.")

VBScript

Sub Test
  Dim i
  If TestedApps.Count > 0 Then
    Log.Message "The project contains the following tested applications:"

    For i = 0 To TestedApps.Count - 1
      Log.Message TestedApps.Items(i).ItemName
    Next
  Else
    Log.Message "The project does not contain tested applications."
  End If
End Sub

DelphiScript

procedure Test;
var i;
begin
  if TestedApps.Count > 0 then
  begin
    Log.Message('The project contains the following tested applications:');

    for i := 0 to TestedApps.Count - 1 do
      Log.Message(TestedApps.Items[i].ItemName);
  end
  else
    Log.Message('The project does not contain tested applications.');
end;

C++Script, C#Script

function Test()
{
  if (TestedApps["Count"] > 0)
  {
    Log["Message"]("The project contains the following tested applications:");

    for (var i = 0; i < TestedApps["Count"]; i++)
      Log["Message"](TestedApps["Items"](i)["ItemName"]);
  }
  else
    Log["Message"]("The project does not contain tested applications.");
}

See Also

TestedApps.Items
TestedApp Object

Highlight search results