Network-related tests for mobile apps need not be such a hassle if the testers are given full control of the network being used. Using a simulated lab network, testers can easily test their mobile apps by simply selecting a network profile and applying it to the device in use. The network profiles carry different parameters like Delay and Upload/Download speed. This feature helps testers to replicate a myriad of network conditions for testing mobile apps.
In order to check how an app performs in slower internet connections, QAs need to simulate slow network speeds and put the app through various user actions. Let's see ways to do this.
Though the steps to Applying a Network Profile to the devices on the platform maybe the same on the New and Old User Interface of the platform. Some options maybe placed elsewhere. If you need instructions for the steps on the Old UI, please scroll down further.
The user should be registered on the pCloudy platform
pCloudy allows users to simulate different network profiles in a manual test or an automated process by using Appium on both iOS and Android. We will dive into this below.
1. Steps to use Network Simulation for manual testing
- Login to the pCloudy platform
- Connect to a device
- Select the Network option on the right pane under "All Actions"
- A dialogue box opens up containing different network profiles
- Select one of the options, and network conditions will be applied to the device. Now the user can run the necessary tests on the app to verify its performance at that particular speed
- Changing network profile
- During the testing session, if a user needs to test the app on other network conditions, the user can Unshape and start the process again.
2. Steps to use Network Simulation for Automation(Appium)
pCloudy provides an easy-to-call method that can be added to user Appium scripts in about 5 to 10 lines of code, depending on what you are trying to do.
Users can use the below-mentioned command in the appium script to shape/unshape the network profile
As an example Refer to the below screenshot
pCloudy Network Profiles
Select one of the options show above, and the network conditions will be applied to the device.
- PacketLoss – Network packet loss.
- latency – Latency applied on packets in the Network. It shows the time that data takes to transfer across the network. Networks with a longer delay or lag have high latency.
- Bandwidth. in/bandwidth.out – Limitation of download and upload network bandwidth from the device.