InstalledApplication Property

Applies to TestComplete 15.42, last modified on September 08, 2022
The information below concerns legacy mobile tests that work with mobile devices connected to the local computer. For new mobile tests, we recommend using the newer cloud-compatible approach.

Description

The InstalledApplication property returns the ApplicationObject object that provides information on the application specified by its zero-based index among the applications installed on the device.

Declaration

ApplicationManagerObj.InstalledApplication(Index)

Read-Only Property
ApplicationManagerObj An expression, variable or parameter that specifies a reference to an ApplicationManager object
Index [in]    Required    Integer    

Applies To

The property is applied to the following object:

Parameters

The property has the following parameter:

Index

Specifies the zero-based index of the application installed on the device. The applications are numbered from 0 to InstalledApplicationCount - 1.

Property Value

The ApplicationObject object that provides information on the appropriate application.

Example

The code below demonstrates how to obtain information on applications stored on an iOS device and post this information to the test log:

JavaScript, JScript

function Test()
{

  var deviceObj = Mobile.Device("iPhone");
  var appManagerObj = deviceObj.ApplicationManager;
  var count = appManagerObj.InstalledApplicationCount;

  for (var i = 0; i < count; i++)
  {
    var appObj = appManagerObj.InstalledApplication(i);

    // Obtain information on the installed application and post it to the test log
    Log.Message("The application container is: " + appObj.Container);
    Log.Message("The application path is: " + appObj.Path);
    Log.Message("The application signing identity is: " + appObj.SignerIdentity);
  }

}

Python

def Test():
  deviceObj = Mobile.Device("iPhone")
  appManagerObj = deviceObj.ApplicationManager
  count = appManagerObj.InstalledApplicationCount

  for i in range (0, count - 1):
    appObj = appManagerObj.InstalledApplication[i]

    # Obtain information on the installed application and post it to the test log
    Log.Message("The application container is: " + appObj.Container)
    Log.Message("The application path is: " + appObj.Path)
    Log.Message("The application signing identity is: " + appObj.SignerIdentity)

VBScript

Sub Test

  Set deviceObj = Mobile.Device("iPhone")
  Set appManagerObj = deviceObj.ApplicationManager
  Set count = appManagerObj.InstalledApplicationCount

  For i = 0 To count - 1
    Set appObj = appManagerObj.InstalledApplication(i)

    ' Obtain information on the installed application and post it to the test log
    Call Log.Message("The application container is: " + appObj.Container)
    Call Log.Message("The application path is: " + appObj.Path)
    Call Log.Message("The application signing identity is: " + appObj.SignerIdentity)
  Next

End Sub

DelphiScript

procedure Test();
var deviceObj, appManagerObj, appObj, count, i;
begin

  deviceObj := Mobile.Device('iPhone');
  appManagerObj := deviceObj.ApplicationManager;
  count := appManagerObj.InstalledApplicationCount;

  for i := 0 to count - 1 do
  begin
    appObj := appManagerObj.InstalledApplication[i];

    // Obtain information on the installed application and post it to the test log
    Log.Message('The application container is: ' + appObj.Container);
    Log.Message('The application path is: ' + appObj.Path);
    Log.Message('The application signing identity is: ' + appObj.SignerIdentity);
  end;

end;

C++Script, C#Script

function Test()
{

  var deviceObj = Mobile["Device"]("iPhone");
  var appManagerObj = deviceObj["ApplicationManager"];
  var count = appManagerObj["InstalledApplicationCount"];

  for (var i = 0; i < count; i++)
  {
    var appObj = appManagerObj["InstalledApplication"](i);

    // Obtain information on the installed application and post it to the test log
    Log["Message"]("The application container is: " + appObj["Container"]);
    Log["Message"]("The application path is: " + appObj["Path"]);
    Log["Message"]("The application signing identity is: " + appObj["SignerIdentity"]);
  }

}

See Also

ApplicationManager Object (Legacy Mobile Testing)
InstalledApplicationCount Property
ApplicationObject Object

Highlight search results