PlatformName Property

Applies to TestComplete 14.10, last modified on June 5, 2019

Description

Returns the name of the iOS platform for which the application is compiled.

Declaration

ApplicationObjectObj.PlatformName

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 name of the iOS platform.

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 platform name is: " + appObj.PlatformName);
    Log.Message("The application platform version is: " + appObj.PlatformVersion);
    Log.Message("The application platform build is: " + appObj.PlatformBuild);
  }

}

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 platform name is: " + appObj.PlatformName)
    Log.Message("The application platform version is: " + appObj.PlatformVersion)
    Log.Message("The application platform build is: " + appObj.PlatformBuild)

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 platform name is: " + appObj.PlatformName)
    Call Log.Message("The application platform version is: " + appObj.PlatformVersion)
    Call Log.Message("The application platform build is: " + appObj.PlatformBuild)
  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 platform name is: ' + appObj.PlatformName);
    Log.Message('The application platform version is: ' + appObj.PlatformVersion);
    Log.Message('The application platform build is: ' + appObj.PlatformBuild);
  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 platform name is: " + appObj["PlatformName"]);
    Log["Message"]("The application platform version is: " + appObj["PlatformVersion"]);
    Log["Message"]("The application platform build is: " + appObj["PlatformBuild"]);
  }

}

See Also

ApplicationObject Object
PlatformBuild Property
PlatformVersion Property (Mobile Applications)
ApplicationManager Object
Working With Tested iOS Applications

Highlight search results