Connect to an enterprise wireless network (Tech preview)
You can use a REST API call to connect a device to a corporate Wi-Fi network. For example, if you have several testing environments, you may need to connect the device to a different network before running an automated test. You may also need to switch to a different network if the network disconnects.
Before you start - iOS devices
iOS devices require a special entitlement to call the API. Therefore, the Wi-Fi app must be installed on any iOS device you want to connect to a Wi-Fi network using the API.
Limitations
Note the following limitations for the WiFi app:
1. The app is supported only on iOS 13 and later.
2. The app should not be re-signed. It uses an Enterprise certificate that needs to be trusted before the app can be run.
Install the WiFi app
-
Locate the WiFi app. The default location is /opt/FunctionalTestingLabForMobileAndWeb/connector/Agent/WiFi/
-
Install the app by running the command
ideviceinstaller -i <ipaPath>
or upload the app to server and install it on the device using the remote device access window. -
The app is signed with an Enterprise certificate, therefore you may get an Untrusted Enterprise Developer alert when you first open it. To trust the app, go to Settings > General > VPN & Device Management and click MicroFocus Ltd. In the Trust dialog, click Trust.
-
Open the app. An alert is displayed. If the app attempts to open the Agent app on your device, click Open.
-
Input the necessary network information. Switch on Debug Mode. Click Connect WiFi.
Caution: Always make sure Debug Mode is switched off when using this app in a production environment.
Use REST API to set a Wi-Fi network connection on device
Use a REST API call to connect the device to a Wi-Fi network.
The /v2/devices/{deviceId}/jobs/{jobId}/WiFi/{ssid} method attempts to establish a connection to the given Wi-Fi network. If the connection is successful, the device connects to the specified network.
Follow these guidelines for the WiFi details.
Parameter | Details |
---|---|
enterpriseType |
The Extensible Authentication Protocol type used. iOS: EAPTLS; EAPTTLS; EAPPEAP; EAPFAST. |
enterpriseName | Your username for the enterprise Wi-Fi network |
enterprisePassphrase | Your password for the enterprise Wi-Fi network. |
enterpriseDomain | The server name for the enterprise Wi-Fi network. |
For details on the required parameters and response body, see the Devices PUT section in the REST API reference. For more details, see REST API reference.