ApplicationObject Object

Applies to TestComplete 15.45, last modified on December 01, 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 ApplicationObject object corresponds to an application installed on an iOS device and provides information on that application, for example, its location, the name of its executable, the signer identity and so on. You can also use the object to run the desired application on a device or remove it from the device.

You can obtain the ApplicationObject object in tests by using the InstalledApplication property and the InstallApplication and GetApplicationByBundleId methods of the ApplicationManager object.

Members

Example

The code below demonstrates how to install the application on an iOS device, obtain the ApplicationObject object that provides information on the installed application, launch the application and then remove it.

JavaScript, JScript

function Test()
{

  // Obtain the ApplicationManager object
  var deviceObj = Mobile.Device("iPhone");
  var appManagerObj = deviceObj.ApplicationManager;
  var appPath = "C:\\Work\\MyApp.ipa";

  // Install the application and obtain the ApplicationObject object
  var appObj = appManagerObj.InstallApplication(appPath);
  // Launch the application
  appManagerObj.RunApplication(appObj);

  // Remove the application
  appManagerObj.RemoveApplication(appObj);
}

Python

def Test():

  # Obtain the ApplicationManager object
  deviceObj = Mobile.Device("iPhone")
  appManagerObj = deviceObj.ApplicationManager
  appPath = "C:\\Work\\MyApp.ipa"

  # Install the application and obtain the ApplicationObject object
  appObj = appManagerObj.InstallApplication(appPath)
  # Launch the application
  appManagerObj.RunApplication(appObj)

  # Remove the application
  appManagerObj.RemoveApplication(appObj)

VBScript

Sub Test

  ' Obtain the ApplicationManager object
  Set deviceObj = Mobile.Device("iPhone")
  Set appManagerObj = deviceObj.ApplicationManager
  appPath = "C:\Work\MyApp.ipa"

  ' Install the application and obtain the ApplicationObject object
  Set appObj = appManagerObj.InstallApplication(appPath)
  ' Launch the application
  appManagerObj.RunApplication(appObj)

  ' Remove the application
  appManagerObj.RemoveApplication(appObj)
End Sub

DelphiScript

procedure Test();
var
  deviceObj, appManagerObj, appObj, appPath : OleVariant;
begin

  // Obtain the ApplicationManager object
  deviceObj := Mobile.Device('iPhone');
  appManagerObj := deviceObj.ApplicationManager;
  appPath := 'C:\Work\MyApp.ipa';

  // Install the application and obtain the ApplicationObject object
  appObj := appManagerObj.InstallApplication(appPath);
  // Launch the application
  appManagerObj.RunApplication(appObj);

  // Remove the application
  appManagerObj.RemoveApplication(appObj);
end;

C++Script, C#Script

function Test()
{

  // Obtain the ApplicationManager object
  var deviceObj = Mobile["Device"]("iPhone");
  var appManagerObj = deviceObj["ApplicationManager"];
  var appPath = "C:\\Work\\MyApp.ipa";

  // Install the application and obtain the ApplicationObject object
  var appObj = appManagerObj["InstallApplication"](appPath);
  // Launch the application
  appManagerObj["RunApplication"](appObj);

  // Remove the application
  appManagerObj["RemoveApplication"](appObj);
}

See Also

ApplicationManager Object (Legacy Mobile Testing)
InstalledApplication Property
GetApplicationByBundleId Method
RunApplication Method
RemoveApplication Method

Highlight search results