How to Effectively Simulate Slow Network Conditions for Testing Your Apps
As an app developer or tester with over 10 years of experience testing on thousands of real mobile devices and browsers, I cannot emphasize enough the importance of testing your apps under slow network conditions.
With mobile usage growing exponentially around the world, you simply cannot make assumptions about internet connectivity anymore. Let me walk you through different techniques you can leverage to simulate slow networks during your app testing phase.
Why Testing in Slow Networks Matters
Global mobile internet usage has exploded in recent years. GSMA intelligence predicts that global mobile data traffic will grow from 0.3 exabytes per month in 2016 to a whopping 3.7 exabytes per month by 2022!
As an app developer or tester, you have to account for this massive growth in mobile usage. You need to specifically test your apps for performance under slow 2G, 3G or congested networks.
If your app fails or has a poor user experience in such networks, you run the huge risk of losing user retention and engagement. No one wants to use an app that has slow load times, frequent timeouts or errors due to network lags.
By simulating slow network conditions during testing, you can catch these performance issues and optimize your app appropriately. Your users will surely appreciate it!
Now let‘s get into the specific techniques you can leverage.
Simulating Slow Network Speeds on iOS Devices
When testing iOS apps, you can use Network Link Conditioner feature in Xcode to throttle network speed. Here is how:
-
Install latest version of Xcode on your Mac system
-
Connect your iPhone/iPad device with a lightning cable
-
When prompted on device, allow access to Xcode
-
On your iOS device go to Settings -> Developer -> Network Link Conditioner
-
Select one of presets e.g. 100 kbps, Very Bad Network
-
Alternatively set custom values for bandwidth, packet loss etc
-
Click Enable to activate this network profile.
This will simulate the chosen network speed on your iOS device in real-time. Pretty neat!
However, the major limitation here is you can only test one device at a time as they have to be physically connected to your Mac.
To test 5 different iPhone models, you need 5 separate devices connected which takes significant effort and time. This can slow down your testing velocity significantly.
Throttling Network Speed for Android App Testing
For Android app testing, you can leverage proxy based tools like Charles Proxy to simulate slow networks. Here are the key steps:
-
Install Charles Proxy application on your computer
-
Enable network throttling from Proxy > Throttle settings tab
-
Select any default preconfigured network profile e.g. Fast 3G, Very Bad Network
-
Optionally, define custom bandwidth, latency values to mimic real world networks
-
Click on Start Throttling to active the selected network profile
This will essentially throttle network speed on your machine allowing you to test Android apps in a simulated slow network environment.
However, testing on Android emulators has several drawbacks compared to real physical Android devices:
- Performance and rendering can differ significantly between emulator and real device
- Hardware specific features like camera, GPS can not be tested
- Hundreds of Android device models/OS versions are not covered
Therefore, you should look to test real Android devices whenever possible for reliable test coverage.
Simulating Slow Networks for Web App Testing
Chrome developer tools provide easy network throttling capabilities for testing web apps in slow network conditions right within the browser.
Follow the below steps:
-
Launch Chrome browser and open the web app you want to test
-
Open Developer tools window (Ctrl + Shift + I)
-
Go to the Network tab
-
Expand Throttling dropdown and select one of profiles:
- Offline
- GPRS
- Regular 2G
- Good 3G
- Fast 3G
- Fast 4G
-
Chrome will throttle the network speed based on chosen network profile.
-
You can now test how your web app performs in slow networks and identify optimizations.
While this is handy, browser based testing alone is not sufficient from a cross-browser compatibility standpoint. Make sure to test across real desktop and mobile browsers with network throttling enabled.
Real Device Cloud – Effortless Network Throttling
All the network simulation approaches we have covered so far provide a decent starting point. However, they have certain limitations around ease of use and scale.
This is where leveraging real device cloud testing can make your life much simpler when comes to testing in slow network conditions.
Here are some major advantages provided by real device cloud testing platforms:
- Simulate different network speeds with full fidelity without needing physical devices
- Network profiles get applied on real commercial devices hosted remotely on the cloud
- Test across 1000+ unique real device/OS and browser combinations
- Advanced custom network profiles to mimic your real world user base
- Dedicated devices that enable long haul testing without interruptions
- Integrates easily into your CI/CD pipeline for automated testing
Let me walk you through a quick example of how BrowserStack App Live enables easy mobile app testing under slow networks on the real device cloud:
-
Sign up for BrowserStack App Live account and login
-
Upload your mobile app or provide app URL
-
Select your target device model, OS and other details
-
Click on Throttle Network option on the left sidebar
-
Choose one of default networks speeds or custom profile
-
Your app will now launch on the chosen real device with network throttled to selected conditions!
-
Run your test automation scripts or manual tests as needed
With BrowserStack real device cloud, you can easily simulate slow network signals (2G, 3G etc) without needing to configure complex emulators, proxies or physical devices!
And similar functionality is also available out of the box for web and web app testing using BrowserStack Live. Just go to Live tab, enable network throttling and access your website to test performance under simulated network constraints within minutes!
Key Takeaways
Here are some parting thoughts:
- Network conditions vary a lot these days so assume good connectivity at your own peril
- Simulate slow networks during testing using tools like Xcode, Charles Proxy and Chrome DevTools
- For mobile app testing, real devices are a must-have compared to emulators
- Real device cloud testing platforms like BrowserStack enable easy and instant testing under slow networks
- Identify performance bottlenecks for your app before releasing to users!
I hope this guide gives you a good overview of techniques you can adopt for testing in slow networks. Feel free to reach out in comments below if you have any other questions! I am happy to help.