If you are from the software industry, chances are that you are already familiar with Fiddler which is used for analytics and debugging purposes. The tool offers powerful capabilities to capture traffic from almost any device. In this post, I have written about the use of Fiddler for mobile application testing.
Some key features of Fiddler:
Fiddler is a web debugging and data monitoring tool. Since this is a proxy tool, it can debug traffic from user machine, MAC system and mobile devices. You can use it to debug traffic from any application that supports Internet explorer, Opera, Firefox, Chrome, Safari or other browsers. It supports frameworks such as .NET, Java and Ruby, among others.
How to capture traffic from mobiles (Android and iOS):
- Install Fiddler on your computer (desktop).
- Go to Tools –> Fiddler Options -> Connections and tick the checkbox for ‘Allow remote computers to connect’.
- On the mobile device, hit this URL in any browser http://ipv4.fiddler:8888/
- Click on the link - Fiddler Root Certificate - and install it on the mobile device.
- To configure device to use proxy, go to settings -> select Wi-Fi.
- For Android devices, tap and hold the network that is connected. Select modify network from popup. Check mark the advanced option. Change Proxy setting to manual and add your computer's IP address in proxy hostname and proxy port set to 8888.
- For iOS devices, select the network that currently connected. In HTTP proxy section, select the manual option and set server to your computer's IP address and port to 8888.
- You can now see your application’s traffic on Fiddler.
Use of fiddler:
- Request/response check: - Once you see the traffic in the web session pane of Fiddler, you can see request-response of different web services used in the application through the Inspector tab on the right hand side pane. It shows different inspectors such as JSON, XML. We can choose any of the inspectors to view data. The user can also view any bottleneck in request or response and track the issue.
- Comparison of two sessions: - We can compare two sessions to see the difference. Select two sessions from the session pane, right click and choose the compare option. Fiddler uses the WinDiff tool to show comparisons. We can manually change it in the registry.
- Generate Request: - The Compose tab of Fiddler can be used for this purpose. The user can generate request for application and execute it to see the response. The user can also save a session or its request/response and re-execute it for other purposes.
- API Testing: - Web APIs can be tested by using the APITest extension of Fiddler. The APITest tab can be accessed by clicking on - View->Tabs->APITest. It shows a list of tests containing API request and validators. Validators provide information about success and failure of test performed.
- Statistics and timeline of session: - The statistics tab shows overall performance metrics of selected session. It gives the number of request, sent and received bytes through sessions. Response bytes can be seen by content types or pie charts. Fiddler gives you information about the files used for generation of page in the selected session.
Timeline provides the start time of the session and total time of execution. You can use this information in performance analysis and to identify relation between numbers of requests. We can easily recognize slow requests and their execution times. Network performance can be optimized by using statistics and timeline charts.
These are some of the ways Fiddler can utilized for mobile application testing. Have questions? Feel free to post in the comments below.