BundleVersion 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

Returns the version number of the application bundle.

Declaration

ApplicationObjectObj.BundleVersion

Read-Only Property String
ApplicationObjectObj An expression, variable or parameter that specifies a reference to an ApplicationObject object

Applies To

The property is applied to the following object:

Property Value

A string value containing the version number of the application bundle.

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 bundle name is: " + appObj.BundleName);
    Log.Message("The application bundle display name is: " + appObj.BundleDisplayName);
    Log.Message("The application bundle identifier is: " + appObj.BundleIdentifier);
    Log.Message("The application bundle version is: " + appObj.BundleVersion);
    Log.Message("The application bundle executable is: " + appObj.BundleExecutable);
  }

}

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 bundle name is: " + appObj.BundleName)
    Log.Message("The application bundle display name is: " + appObj.BundleDisplayName)
    Log.Message("The application bundle identifier is: " + appObj.BundleIdentifier)
    Log.Message("The application bundle version is: " + appObj.BundleVersion)
    Log.Message("The application bundle executable is: " + appObj.BundleExecutable)

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 bundle name is: " + appObj.BundleName)
    Call Log.Message("The application bundle display name is: " + appObj.BundleDisplayName)
    Call Log.Message("The application bundle identifier is: " + appObj.BundleIdentifier)
    Call Log.Message("The application bundle version is: " + appObj.BundleVersion)
    Call Log.Message("The application bundle executable is: " + appObj.BundleExecutable)
  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 bundle name is: ' + appObj.BundleName);
    Log.Message('The application bundle display name is: ' + appObj.BundleDisplayName);
    Log.Message('The application bundle identifier is: ' + appObj.BundleIdentifier);
    Log.Message('The application bundle version is: ' + appObj.BundleVersion);
    Log.Message('The application bundle executable is: ' + appObj.BundleExecutable);
  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 bundle name is: " + appObj["BundleName"]);
    Log["Message"]("The application bundle display name is: " + appObj["BundleDisplayName"]);
    Log["Message"]("The application bundle identifier is: " + appObj["BundleIdentifier"]);
    Log["Message"]("The application bundle version is: " + appObj["BundleVersion"]);
    Log["Message"]("The application bundle executable is: " + appObj["BundleExecutable"]);
  }

}

See Also

ApplicationObject Object
BundleIdentifier Property
BundleName Property
BundleDisplayName Property
BundleExecutable Property
ApplicationManager Object (Legacy Mobile Testing)
Working With Tested iOS Applications (Legacy)
Testing iOS Applications (Legacy)

Highlight search results