
As testers, we are responsible for verifying that an application works under various conditions. It’s important to test the way our applications behave in not-so-ideal conditions, like when a user has a slow network connection.
So, how do we get started?
Simulating a slow Internet connection from the browser
Ideally, cross-browser testing should be performed to validate that an app performs well with Google Chrome, Microsoft Edge, and Mozilla Firefox. To test a slow connection on the web, we use the Developer Tools that are available with all major browsers.
To access the Developer Tools, simply go to the browser’s menu, select More Tools, and Developer Tools for Chrome or Edge, or Web Developer Tools if using Firefox. This will open up a pane on the side of the browser window. From here, the settings will slightly vary depending on the browser, but the principle is the same.
Google Chrome and Microsoft Edge
In Chrome, go to the Network tab in Developer Tools. Here, you’ll see a “No throttling” drop-down option. This is the default option, and it simply means that when we navigate the web, we are using our normal network connection. If you expand the dropdown, you’ll see the other predefined options provided by Chrome.
You can choose to go offline or create your custom throttling settings:
Edge and Chrome are identical in this regard. Firefox is similar, with some extra default options:
Extensions
You can also add extensions to your browser that can simulate various network settings. A good example is URL Throttler for Chrome, which allows you to add a customized delay to certain web pages (use regular expressions to define which pages the delay should apply to):
Using Fiddler
Since desktop applications are stand-alone, they probably don’t have any specific settings and we’ll need some outside help. Here’s where Fiddler comes in. It’s a debugging proxy server tool that helps with logging, inspecting, and modifying HTTP requests. It works on Windows, Linux, and Mac OS.
Another good thing Fiddler can do is to simulate a slow connection. Open the Rules menu, and select Customize Rules:
This will open up the FiddlerScript Rules files in an editor. Inside the editor, condition if (m_SimulateModem) will simulate a modem.
As you see, there are two values: one for delaying the request, and one for delaying the response. We can adjust both values as needed. After that, save the file and close it.
Keep in mind that the condition that verifies if we are simulating a modem is still false, so the delays won’t happen yet. To make it true, expand the Rules menu again, and select Performance -> Simulate Modem Speeds:
All requests and responses will be delayed, so you can see how your application behaves when it takes longer to send or receive information. Remember to disable the option and/or close Fiddler once you are done with your tests, so you can use your regular network connection.
Using Clumsy
Clumsy is another free app that lets you simulate various network problems as you test:
Android
Some Android devices only support 2G connections. That’s a good start, but it’s not available on all devices. Windows users can use Clumsy to slow down a connection, create a mobile hotspot from a PC, and connect the mobile device being tested to that hotspot.
iOS
For iOS devices, simulate a slow network connection from the Developer Settings. You must install Xcode, which requires a Mac computer.
After you install XCode, you need to connect your device to it and access the Developer Settings from the Settings menu. From here, choose Network Link Conditioner, which gives you a series of settings, including the option to add your own customized profile:
Using Android Virtual Device Manager (AVD)
If using an emulated device on AVD, access its configuration and in the Advanced Settings, change the Speed and/or Latency values under Network:
Then, restart your device and start testing!
It’s important to know that the applications we are testing don’t fail when used with slower connectivity. Whether you’re conducting web, mobile, or desktop testing, there are multiple ways to simulate the slow Internet connection you need to execute your tests.
About the author
Andreea Draniceanu
Andreea is a QA engineer, experienced in web and desktop applications, and always looking to improve her automation skills and knowledge. Her current focus is on automation testing with C#.