InstalledPackageCount Property

Applies to TestComplete 15.47, last modified on January 20, 2023
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 InstalledPackageCount property returns the number of packages installed on the device.

Declaration

PackageManagerObj.InstalledPackageCount

Read-Only Property Integer
PackageManagerObj An expression, variable or parameter that specifies a reference to a PackageManager object

Applies To

The property is applied to the following object:

Property Value

The number of packages installed on the device.

Example

The following code uses the InstalledPackageCount property to get the number of packages installed on the device and then posts this number to the test log:

JavaScript, JScript

function Test()
{
  var DeviceObj = Mobile.Device("MyDevice");
  var PackManagerObj = DeviceObj.PackageManager;
  var Num = PackManagerObj.InstalledPackageCount;
  Log.Message("The number of installed packages is: " + aqConvert.VarToStr(Num));
}

Python

def Test():
  DeviceObj = Mobile.Device("MyDevice")
  PackManagerObj = DeviceObj.PackageManager
  Num = PackManagerObj.InstalledPackageCount
  Log.Message("The number of installed packages is: " + aqConvert.VarToStr(Num))

VBScript

Sub Test
  Set DeviceObj = Mobile.Device("MyDevice")
  Set PackManagerObj = DeviceObj.PackageManager
  Num = PackManagerObj.InstalledPackageCount
  Call Log.Message("The number of installed packages is: " + aqConvert.VarToStr(Num))
End Sub

DelphiScript

function Test;
var DeviceObj, PackManagerObj, Num: OleVariant;
begin
  DeviceObj := Mobile.Device('MyDevice');
  PackManagerObj := DeviceObj.PackageManager;
  Num := PackManagerObj.InstalledPackageCount;
  Log.Message('The number of installed packages is: ' + aqConvert.VarToStr(Num));
end;

C++Script, C#Script

function Test()
{
  var DeviceObj = Mobile["Device"]("MyDevice");
  var PackManagerObj = DeviceObj["PackageManager"];
  var Num = PackManagerObj["InstalledPackageCount"];
  Log["Message"]("The number of installed packages is: " + aqConvert["VarToStr"](Num));
}

See Also

InstallPackage Method
PackageManager Object

Highlight search results