Get network settings (FR)

Perfecto Command

mobile:network.settings:get

Purpose

Returns the status of the network setting specified: wifi, data (only for devices with a valid SIM card installed), and/or airplane-mode. Can insert the retrieved value into a defined variable. Use the Property parameter to specify the network setting to retrieve.

This command is supported for both Android and iOS devices.

Important: If Airplane Mode is enabled, Data will be disabled.

Parameters

Name Type Possible Values Description
property String wifi | data | airplanemode

The network setting property to retrieve:
WiFi
Data
Airplane mode

Return Value

Indicates if the requested network is "true" (on) or "false" (off)

Exceptions

None

Examples

Copy

Java sample

Map<String, Object> pars = new HashMap<>();
pars.put("property", "wifi");
String reStr = (String) driver.executeScript("mobile:network.settings:get", pars);
Copy

C#

Dictionary<String, Object> pars = new Dictionary<String, Object>();
pars.Add("property", "wifi");
String reStr = (String) driver.ExecuteScript("mobile:network.settings:get", pars);