Count Property

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

Description

The Count property specifies the number of application instances that are simultaneously launched during the test recording or run. This is the same value as the one specified in the Count parameter of the application in the TestedApps editor.

During the test run, this value affects the Run TestedApp keyword test operation and the TestedApps.RunAll and TestedApps.AppName.Run scripting methods.

Declaration

TestedAppObj.Count

Read-Write Property Integer
TestedAppObj An expression, variable or parameter that specifies a reference to a TestedApp object

Applies To

The property is applied to the following object:

Property Value

The number of application instances to be simultaneously launched during the test recording or run.

Remarks

The Count property is used by methods that launch applications included in the project’s tested applications list. The property not only specifies the number of instances to be launched, but the total number of instances that should be running in the system. Suppose, Count is 7 and there are 5 application instances running in the system. When you command TestComplete to launch the tested application, TestComplete will only create two new instances, so the total number of instances is equal to Count (5 + 2 = 7).

The Count property is ignored if the Profile run mode is selected for the application. Also, the Count property is ignored by the DbgServices.LaunchTestedApplication method (this method always creates one new application instance).

Example

The following example demonstrates how you can specify the number of an application’s instances to be run and then launch all of them.

JavaScript, JScript

function Test()
{

  var SampleApp;
  // Obtains the tested application
  SampleApp = TestedApps.Items("SampleApp");
  // Specifies the total number of instances to be run
  SampleApp.Count = 3;
  // Launches the tested application
  SampleApp.Run();
  …
  // Closes the tested application
  SampleApp.Close();

}

Python

def Test():
  # Obtains the tested application
  SampleApp = TestedApps.Items["SampleApp"]
  # Specifies the total number of instances to be run
  SampleApp.Count = 3
  #  Launches the tested application
  SampleApp.Run()
  # ...
  # Closes the tested application
  SampleApp.Close()

VBScript

Sub Test

  Dim SampleApp
  ' Obtains the tested application
  Set SampleApp = TestedApps.Items("SampleApp")
  ' Specifies the total number of instances to be run
  SampleApp.Count = 3
  ' Launches the tested application
  SampleApp.Run
  …
  ' Closes the tested application
  SampleApp.Close

End Sub

DelphiScript

procedure Test();
var SampleApp;
begin

  // Obtains the tested application
  SampleApp := TestedApps.Items('SampleApp');
  // Specifies the total number of instances to be run
  SampleApp.Count := 3;
  // Launches the tested application
  SampleApp.Run;
  …
  // Closes the tested application
  SampleApp.Close;

end;

C++Script, C#Script

function Test()
{

  var SampleApp;
  // Obtains the tested application
  SampleApp = TestedApps["Items"]("SampleApp");
  // Specifies the total number of instances to be run
  SampleApp["Count"] = 3;
  // Launches the tested application
  SampleApp["Run"]();
  …
  // Closes the tested application
  SampleApp["Close"]();

}

See Also

Launch Property
Run Method
TestedApps.RunAll
DbgServices.LaunchTestedApplication
DbgServices.LaunchAllTestedApplications

Highlight search results