Tag Archives: Charles

What is Charles Proxy?

– Usually we (QA) are asked to add the API request and response to the Bug/Jira that we raise during testing cycles. This is where Charles Proxy comes into picture. Charles Proxy is a tool mainly used to monitor the HTTP and SSL/HTTPS traffic between the web browser/client and the server. In simple words, Charles is used to view the API ‘Request’ sent to the server and ‘Response’ received from the server.

Configuring Charles Proxy :

Before we start using Charles, lets see how we can configure it. Below are the settings that need to be done in order to use Charles Proxy.

Settings to be Done on Laptop:

1- Ensure that the Laptop is connected to Wifi.
2- Download and install latest version of Charles Proxy from Here.
3- Open Charles Proxy. Purchase and add a license under ‘Help’.
4- Go to Proxy > Proxy Settings.
5- In ‘Proxies’ tab, under HTTP Proxy enter the port number as 8888.

Settings to be done on Mobile:

1- Find the IP associated with the Wi-Fi network to which your system is connected to.
2- Your mobile device should be connected to the same Wi-Fi network your Laptop is connected to.

For iOS Devices:

  1. Under the settings tap on Wi-Fi.                                                                                                            1
  2. Tap on the “i” icon beside the Wi-Fi network you are connected to.                                               2
  3. Under the HTTP Proxy section tap ‘Manual’ and enter the IP address of your Mac/Windows Machine running Charles Proxy and the port Charles Proxy is running on.                                  4 3
  4. Open Safari on your mobile device and visit a website. The following should pop up on your mac. Click Allow.                                                                                                                                       5
  5. You should now be able to sniff HTTP traffic. Visit the host on mobile safari. You may get a security warning due to the self signed certificate Charles will present . You want to add an exception for that host.
  6. Open the mobile app and you should be able to observe HTTPs traffic. The mobile iOS/Android client should accept self signed certificates. The Care iOS App, for instance, is built to allow this for dev/qa builds but not for production builds.

For Android Devices:

 

  1. Under the settings tap on Wi-Fi.
  2. Make sure that the device is connected to the same network as your system is.
  3. Long press on the Wi-Fi to which the device is connected to. A pop over will be displayed.a1
  4. Tap on Modify Network.
  5. Select the ‘Show Advanced options’.                                                                       A2
  6. Tap on ‘None’ under ‘Proxy’ and select ‘Manual’ option.
  7. In the Proxy Hostname enter the IP address of the network to which your system is connected to.
  8. In Proxy port enter the port number – 8888.                                                                                       a3
  9. Open the mobile app and you should be able to observe HTTP traffic.

Conclusion:

In the above article i have covered how to configure Charles Proxy and how we can monitor the API request and response. This mainly comes handy while testing the native iOS and Android applications.