The majority of mobile apps communicate with the external world. Sometimes we know how that happens sometimes we don’t.
Anyway, there is a tool set that allows you to check app’s network communication from different points of view. Every tool has its own pros and cons. In this article we want share our experience.
Charles - a web debugging proxy
The Charles proxy server helps to monitor HTTP requests/responses, HTTP headers (contain the cookies and caching information) and allows you to emulate your own test requests/responses to/from server. The most important of these is that additional rare cases can be emulated.
What does it help to check?
In the table below we will share more specific information.
|Devices traffic analysis||This is useful if a mobile application communicates with an internet server|
|SSL Proxying – view SSL requests and responses in plain text||Helps to analyze communication between an application and the SSL secured web server|
|Bandwidth Throttling to simulate slower Internet connections including latency||A good way to test connection timeouts. Throttling allows you to simulate any type of connection: GPRS/2G/3G/4G|
|AJAX debugging – view XML and JSON requests and responses as a tree or as a text||An easy way to analyze data traffic in different types of data structure view|
|Repeat requests to test back-end changes||It is required for back-end changes testing and makes it unnecessary to repeat the request in the browser (or other client).|
|Edit requests/responses to test different inputs||A good way to test an application for the possibility to handle new/wrong responses|
|Breakpoints to intercept and edit requests or responses||An easy way to intercept each request and response and, if needed, to cancel, execute or abort them|
Fiddler - a web debugging proxy
Fiddler is a free alternative for Charles but with more complicated UI. It debugs traffic from Android/iOS/Windows Phone/PC/Mac/Linux systems. It ensures that proper cookies, headers and cache directives are transferred between client and server.
Unlike Charles, this web debugging proxy is free, which gives it an advantage. It is a proxy which logs all HTTP(s) traffic between your computer/mobile device and the Internet.
|- It is free||- Complicated UI|
|- Can intercept requests and responses and modify them||- No stable versions for Linux and Mac OS|
|- Bandwidth throttling to simulate slower Internet connections including latency||- Inconvenient configuration bandwidth throttling and proxy settings|
Postman - REST Client
Postman is a plugin for the Chrome WEB Browser, which helps you test APIs more efficiently.
Add a few parameters to the sent request and the server will think that you are using a mobile app even if it is not completed yet.
What does it help to check?
|HTTP requests with file upload support||When a test is required to upload files|
|Formatted API responses for JSON and XML||Always required, otherwise 99% of the response is unreadable|
|Open responses as an HTML file in a new window||When a response is very big because the Postman preview is very small|
|Image previews||Sometimes you need to see the resulting image, for example when they are generated on the server|
|Request history||Constantly needed, so not to fill in all the fields again, you can simply dig in the history|
Notepad++ is a free source code editor and Notepad replacement that supports several languages.
Notepad++ has the Compare plugin and JSTool plugin - A JSON data viewer.
|Compare difference between 2 files (server responses)||Compare plugin: a useful diff plugin to show a difference between 2 files (server responses)|
|View and edit JSON response||JSON viewer plugin: displays the selected JSON string in a tree view. JSON data viewer can handle >10MB JSON file easily|
SEE ALSO: A GUIDE TO APP UI PORTING
Works for iOS projects only
Device: iOS Developer Settings - Network Link conditioner
The Developer Options menu in iOS is hidden. To enable it, connect the device to your computer over USB, open Xcode → Organizer and select Use for Development. These settings are intended for developers, but many of them will be interesting for QA engineers:
Network Link conditioner: Apple has included a network link conditioner right in iOS that helps to simulate different types of network connections right on the development device. To simulate a specific profile simply tap the profile and then Enable the network link conditioner with the toggle at the top of the list view.
You can create your own profiles, but the default list contains the following:
- 100% Loss
- High Latency DNS
- Very Bad Network
* Having finished testing, remember to turn off Network Link Conditioner, as there is no indicator in the status bar or outside of Settings to alert you that it's on.
Depending on a particular case, budget availability and individual preferences QA engineers may find an appropriate tool to satisfy their needs.