WifiInfo 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 an object that describes the Wi-Fi connection to the tested Android device.

Declaration

ProgObj.WifiInfo

Read-Only Property A WifiInfo object
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 object:

Property Value

The WifiInfo object that provides information about the Wi-Fi connection to an Android device.

Example

The following example demonstrates how to obtain Wi-Fi connection data.

JavaScript, JScript

function GetWifiInfo()
{
  var DeviceWifiInfo = Mobile.Device("MyDevice").Connections.WifiInfo;
  
  // Output the Wi-Fi data
  Log.Message("Device IP address: " + DeviceWifiInfo.IpAddress);
  Log.Message("Current link speed: " + DeviceWifiInfo.LinkSpeed);
  Log.Message("MAC address: " + DeviceWifiInfo.MacAddress);
  Log.Message("Received signal strength: " + DeviceWifiInfo.SignalStrength);
  Log.Message("SSID: " + DeviceWifiInfo.SSID);
  Log.Message("Supplicant state: " + DeviceWifiInfo.SupplicantState);
}

Python

def GetWifiInfo():
    DeviceWifiInfo = Mobile.Device("VirtualBox").Connections.WifiInfo
    
    # Output the Wi-Fi data
    Log.Message("Device IP address: " + DeviceWifiInfo.IpAddress)
    Log.Message("Current link speed: " + VarToStr(DeviceWifiInfo.LinkSpeed))
    Log.Message("MAC address: " + DeviceWifiInfo.MacAddress)
    Log.Message("Received signal strength: " + VarToStr(DeviceWifiInfo.SignalStrength))
    Log.Message("SSID: " + DeviceWifiInfo.SSID)
    Log.Message("Supplicant state: " + DeviceWifiInfo.SupplicantState)

VBScript

 Sub GetWifiInfo
  Set DeviceWifiInfo = Mobile.Device("MyDevice").Connections.WifiInfo
  
  ' Output the Wi-Fi data
  Log.Message("Device IP address: " & DeviceWifiInfo.IpAddress)
  Log.Message("Current link speed: " & DeviceWifiInfo.LinkSpeed)
  Log.Message("MAC address: " & DeviceWifiInfo.MacAddress)
  Log.Message("Received signal strength: " & DeviceWifiInfo.SignalStrength)
  Log.Message("SSID: " & DeviceWifiInfo.SSID)
  Log.Message("Supplicant state: " & DeviceWifiInfo.SupplicantState)
 End Sub

DelphiScript

procedure GetWifiInfo();
var DeviceWifiInfo;
begin
  DeviceWifiInfo := Mobile.Device('MyDevice').Connections.WifiInfo;
  
  // Output the Wi-Fi data
  Log.Message('Device IP address: ' + DeviceWifiInfo.IpAddress);
  Log.Message('Current link speed: ' + VarToStr(DeviceWifiInfo.LinkSpeed));
  Log.Message('MAC address: ' + DeviceWifiInfo.MacAddress);
  Log.Message('Received signal strength: ' + VarToStr(DeviceWifiInfo.SignalStrength));
  Log.Message('SSID: ' + DeviceWifiInfo.SSID);
  Log.Message('Supplicant state: ' + DeviceWifiInfo.SupplicantState);
end;

C++Script, C#Script

function GetWifiInfo()
{
  var DeviceWifiInfo = Mobile["Device"]("MyDevice").Connections["WifiInfo"]
  
  // Output the Wi-Fi data
  Log["Message"]("Device IP address: " + DeviceWifiInfo["IpAddress"]);
  Log["Message"]("Current link speed: " + DeviceWifiInfo["LinkSpeed"]);
  Log["Message"]("MAC address: " + DeviceWifiInfo["MacAddress"]);
  Log["Message"]("Received signal strength: " + DeviceWifiInfo["SignalStrength"]);
  Log["Message"]("SSID: " + DeviceWifiInfo["SSID"]);
  Log["Message"]("Supplicant state: " + DeviceWifiInfo["SupplicantState"]);
}

See Also

AndroidConnections Object
WifiInfo Object
Testing Android Applications (Legacy)
Working With Android Device Settings During Test Run (Legacy)

Highlight search results