TestedApps.Items Property

Applies to TestComplete 15.69, last modified on November 13, 2024

Description

The Items property returns the TestedApp object specified by the name or index that this object has in the list of applications.

Declaration

TestedApps.Items(Index)

Read-Only Property A TestedApp, AIRTestedApp, AndroidTestedApp, ClickOnceTestedApp, BrowserTestedApp, iOSTestedApp or JavaTestedApp object
Index [in]    Required    Variant    

Applies To

The property is applied to the following object:

Parameters

The property has the following parameter:

Index

Specifies the application item that you want to obtain. You can specify the desired item by its name or zero-based index in the list of applications. To learn the total number of items in the list, use TestedApps.Count.

Property Value

The TestedApp, AIRTestedApp, AndroidTestedApp, ClickOnceTestedApp, BrowserTestedApp, iOSTestedApp or JavaTestedApp object that represents the tested application you want to get.

Remarks

If you use Python or DelphiScript, you should enclose the parameter of the TestedApps.Items property in square brackets: TestedApps.Items[Index].

Example

The following example obtains tested applications, modifies their properties and launches them.

JavaScript, JScript

function TestedAppsItemsDemo()
{

  var TestApp1, TestApp2;
  // Obtains a tested application by its index
  TestApp1 = TestedApps.Items(1);
  // Obtains a tested application by its name
  TestApp2 = TestedApps.Items("SampleApp");
  // Enables the "Launch" parameter for the tested applications
  TestApp1.Launch = true;
  TestApp2.Launch = true;
  // Launches the tested applications
  TestApp1.Run();
  TestApp2.Run();

}

Python

def TestedAppsItemsDemo():
  # Obtains a tested application by its index
  TestApp1 = TestedApps.Items[0]
  # Obtains a tested application by its name
  TestApp2 = TestedApps.Items["SampleApp"]
  # Enables the "Launch" parameter for the tested applications
  TestApp1.Launch = True
  TestApp2.Launch = True
  # Launches the tested applications
  TestApp1.Run()
  TestApp2.Run()

VBScript

Sub TestedAppsItemsDemo

  Dim TestApp1, TestApp2
  ' Obtains a tested application by its index
  Set TestApp1 = TestedApps.Items(1)
  ' Obtains a tested application by its name
  Set TestApp2 = TestedApps.Items("SampleApp")
  ' Enables the "Launch" parameter for the tested applications
  TestApp1.Launch = True
  TestApp2.Launch = True
  ' Launches the tested applications
  TestApp1.Run
  TestApp2.Run

End Sub

DelphiScript

procedure TestedAppsItemsDemo();
var TestApp1, TestApp2;
begin

  // Obtains a tested application by its index
  TestApp1 := TestedApps.Items(1);
  // Obtains a tested application by its name
  TestApp2 := TestedApps.Items('SampleApp');
  // Enables the "Launch" parameter for the tested applications
  TestApp1.Launch := true;
  TestApp2.Launch := true;
  // Launches the tested applications
  TestApp1.Run;
  TestApp2.Run;

end;

C++Script, C#Script

function TestedAppsItemsDemo()
{

  var TestApp1, TestApp2;
  // Obtains a tested application by its index
  TestApp1 = TestedApps["Items"](1);
  // Obtains a tested application by its name
  TestApp2 = TestedApps["Items"]("SampleApp");
  // Enables the "Launch" parameter for the tested applications
  TestApp1["Launch"] = true;
  TestApp2["Launch"] = true;
  // Launches the tested applications
  TestApp1["Run"]();
  TestApp2["Run"]();

}

See Also

TestedApps.Count
TestedApp Object
AIRTestedApp Object
AndroidTestedApp Object
BrowserTestedApp Object
ClickOnceTestedApp Object
JavaTestedApp Object

Highlight search results