Name Property

Applies to TestComplete 15.63, last modified on April 23, 2024
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

Specifies the name of the application that corresponds to the package for which the property is called.

Declaration

PackageObjectObj.Name

Read-Only Property String
PackageObjectObj An expression, variable or parameter that specifies a reference to a PackageObject object

Applies To

The property is applied to the following object:

Property Value

The name of the application that corresponds to the specified package.

Example

The code below iterates through the packages installed on the device and posts their names and paths on the device to the test log:

JavaScript, JScript

function Test()
{
  var DeviceObj = Mobile.Device("VirtualBox");
  var PackManagerObj = DeviceObj.PackageManager;
  var Num = PackManagerObj.InstalledPackageCount;
  
  for (var i = 0; i < Num; i++)
  {
    var PackObj = PackManagerObj.InstalledPackage(i);
    // Obtain the package name
    Log.Message("The package name is: " + PackObj.Name);
    // Obtain the path to the package on the device
    Log.Message("The package device path is: " + PackObj.DevicePath);
  }
  
}

Python

def Test():
  DeviceObj = Mobile.Device("VirtualBox")
  PackManagerObj = DeviceObj.PackageManager
  Num = PackManagerObj.InstalledPackageCount
  
  for i in range (0, Num - 1):
    PackObj = PackManagerObj.InstalledPackage(i)
    # Obtain the package name
    Log.Message("The package name is: " + PackObj.Name)
    # Obtain the path to the package on the device
    Log.Message("The package device path is: " + PackObj.DevicePath)

VBScript

Sub Test
  Set DeviceObj = Mobile.Device("VirtualBox")
  Set PackManagerObj = DeviceObj.PackageManager
  Num = PackManagerObj.InstalledPackageCount
  
  For i = 0 to Num - 1
    Set PackObj = PackManagerObj.InstalledPackage(i)
    ' Obtain the package name
    Call Log.Message("The package name is: " + PackObj.Name)
    ' Obtain the path to the package on the device
    Call Log.Message("The package device path is: " + PackObj.DevicePath)
  Next
  
End Sub

DelphiScript

function Test;
var DeviceObj, PackManagerObj, Num, i, PackObj: OleVariant;
begin
  DeviceObj := Mobile.Device('VirtualBox');
  PackManagerObj := DeviceObj.PackageManager;
  Num := PackManagerObj.InstalledPackageCount;
  
  for i := 0 to Num - 1 do
  begin
    PackObj := PackManagerObj.InstalledPackage(i);
    // Obtain the package name
    Log.Message('The package name is: ' + PackObj.Name);
    // Obtain the path to the package on the device
    Log.Message('The package device path is: ' + PackObj.DevicePath);
  end;
  
end;

C++Script, C#Script

function Test()
{
  var DeviceObj = Mobile["Device"]("VirtualBox");
  var PackManagerObj = DeviceObj["PackageManager"];
  var Num = PackManagerObj["InstalledPackageCount"];
  
  for (i = 0; i < Num; i++)
  {
    var PackObj = PackManagerObj["InstalledPackage"](i);
    // Obtain the package name
    Log["Message"]( "The package name is: " + PackObj["Name"] );
    // Obtain the path to the package on the device
    Log["Message"]( "The package device path is: " + PackObj["DevicePath"] );
  }
  
}

See Also

PackageObject Object
PCPath Property
DevicePath Property

Highlight search results