Index Property

Applies to TestComplete 14.72, last modified on December 24, 2020

Description

Returns the index of the device among other connected devices with the same name.

Declaration

ProgObj.Index

Read-Only Property Integer
ProgObj An expression, variable or parameter that specifies a reference to one of the objects listed in the Applies To section

Applies To

The property is applied to the following objects:

Property Value

An integer value that specifies the device's index (starting from zero).

Example

The code below posts the index of the specified device to the test log:

JavaScript, JScript

function PostIndex()
{
  Log.Message(Mobile.Device("MobileDevice", 2).Index);
}

Python

def PostIndex():
  Log.Message(Mobile.Device("MobileDevice", 2).Index)

VBScript

Sub PostIndex
  Log.Message Mobile.Device("MobileDevice", 2).Index
End Sub

DelphiScript

procedure PostIndex();
begin
  Log.Message(Mobile.Device('MobileDevice', 2).Index);
end;

C++Script, C#Script

function PostIndex()
{
  Log["Message"](Mobile["Device"]("MobileDevice", 2)["Index"]);
}

See Also

AndroidDevice Object
iOSDevice Object
Testing Android Applications
Testing iOS Applications

Highlight search results