AndroidConnections Object

Applies to TestComplete 14.72, last modified on April 22, 2021

Description

The AndroidConnections object provides an interface to the connection settings of the mobile device. You can use this object to enable or disable Bluetooth and Wi-Fi on the device.

The AndroidConnections object is returned by the Connections property of the Device object.

In order for TestComplete to provide access to WiFi and Bluetooth settings, the following conditions must be met:

Members

Example

The following example uses the Connections property to check if Wi-Fi is enabled on the device and posts this information to the log.

JavaScript, JScript

function Test()
{
  Mobile.SetCurrent("MyDevice")
  if (Mobile.Device().Connections.WiFiEnabled)
    Log.Message("Wi-Fi is enabled")
  else
    Log.Message("Wi-Fi is disabled")
}

Python

def Test():
  Mobile.SetCurrent("MyDevice")
  if Mobile.Device().Connections.WiFiEnabled:
    Log.Message("Wi-Fi is enabled")
  else:
    Log.Message("Wi-Fi is disabled")

VBScript

Sub Test()
  Mobile.SetCurrent("MyDevice")
  If Mobile.Device.Connections.WiFiEnabled Then
    Log.Message("Wi-Fi is enabled")
  Else
    Log.Message("Wi-Fi is disabled")
  End If
End Sub

DelphiScript

procedure Test();
begin
  Mobile.SetCurrent('MyDevice');
  if Mobile.Device.Connections.WiFiEnabled then
    Log.Message('Wi-Fi is enabled')
  else
    Log.Message('Wi-Fi is disabled')
end;

C++Script, C#Script

function Test()
{
  Mobile["SetCurrent"]("MyDevice")
  if (Mobile["Device"].Connections["WiFiEnabled"])
    Log["Message"]("Wi-Fi is enabled")
  else
    Log["Message"]("Wi-Fi is disabled")
}

See Also

AndroidDevice Object
GPS Property

Highlight search results