DeviceInfo 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 iOSDeviceInfo object providing detailed information about the given iOS device.

Declaration

iOSDeviceObj.DeviceInfo

Read-Only Property An iOSDeviceInfo object.
iOSDeviceObj An expression, variable or parameter that specifies a reference to an iOSDevice object

Applies To

The property is applied to the following object:

Property Value

The iOSDeviceInfo object that contains information about the device (such as the CPU architecture, model number and so on).

Remarks

To obtain information on the connected iOS device, use the iOSDeviceInfo object returned by the DeviceInfo property of the appropriate iOSDevice object.

Example

The code below gets the iOSDeviceInfo object and posts the value of some of its properties to the test tog:

JavaScript, JScript

function GetDeviceInfo()
{
  var DeviceInfoObj = Mobile.Device("iPhone").DeviceInfo;
  Log.Message("Device serial number: " + DeviceInfoObj.SerialNumber);
  Log.Message("Device model number: " + DeviceInfoObj.ModelNumber);
  Log.Message("CPU architecture:" + DeviceInfoObj.CPUArchitecture);
}

Python

def GetDeviceInfo():
   DeviceInfoObj = Mobile.Device("iPhone").DeviceInfo
   Log.Message("Device serial number: " + DeviceInfoObj.SerialNumber)
   Log.Message("Device model number: " + DeviceInfoObj.ModelNumber)
   Log.Message("CPU architecture: " + DeviceInfoObj.CPUArchitecture)

VBScript

Sub GetDeviceInfo
  Set DeviceInfoObj = Mobile.Device("iPhone").DeviceInfo
  Log.Message("Device serial number: " & DeviceInfoObj.SerialNumber)
  Log.Message("Device model number: " & DeviceInfoObj.ModelNumber)
  Log.Message("CPU architecture: " & DeviceInfoObj.CPUArchitecture)
End Sub

DelphiScript

procedure GetDeviceInfo();
var DeviceInfoObj;
begin
   DeviceInfoObj := Mobile.Device('iPhone').DeviceInfo;
   Log.Message('Device serial number: ' + DeviceInfoObj.SerialNumber);
   Log.Message('Device model number: ' + DeviceInfoObj.ModelNumber);
   Log.Message('CPU architecture: ' + DeviceInfoObj.CPUArchitecture);
end;

C++Script, C#Script

function GetDeviceInfo()
{
  var DeviceInfoObj = Mobile["Device"]("iPhone")["DeviceInfo"];
  Log["Message"]("Device serial number: " + DeviceInfoObj["SerialNumber"]);
  Log["Message"]("Device model number: " + DeviceInfoObj["ModelNumber"]);
  Log["Message"]("CPU architecture:" + DeviceInfoObj["CPUArchitecture"]);
}

See Also

iOSDevice Object
iOSDeviceInfo Object
DeviceInfo (Android Testing)
Testing iOS Applications (Legacy)

Highlight search results