Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I would like to test the behavior of my app in case of slow network. Can Charles Proxy do it? please give me some guidance. Many thanks.

share|improve this question
    
Your app uses only HTTP(s) requests? Wondering since the proxy software you mention is not suitable for other network behavior. –  Niels van Reijmersdal May 14 at 13:30
    
I mean the Charles proxy is capable of simulating weak/loss network conditions for testing. But I do not know how doing it. If this tool is not suitable, please suggest the right :) –  Cuong Nguyen May 16 at 4:00
add comment

3 Answers 3

up vote 2 down vote accepted

First of all, you need to know how to connect your mobile phone with Charles proxy.

Here are the quick and easy steps to set this up (I am using iPhone, but you can also connect android devices using step in this post: http://jaanus.com/blog/2012/02/12/debugging-http-on-an-android-phone-or-tablet-with-charles-proxy-for-fun-and-profit/):

  1. Make sure that your iOS device and your laptop are connected to the same wireless network.

  2. On your laptop (OSX) go into System Preferences -> Network to find your IP Address.

  3. Then on your iOS device, go into Settings, Wi-Fi

  4. Click the little arrow beside your wireless network to see the details of the network

  5. For the proxy settings at the bottom of the screen, select “Manual” and enter the IP Address you found on step 2 and the default port that Charles Proxy listens to is 8080.

  6. Now your iOS device will be connecting to the internet through your laptop on the port that Charles is monitoring. All your network requests from your iOS device will be viewable in your Charles window

Now you can test your application and see what network calls your app is making, and what responses it is getting back to help you troubleshoot all of those hard-to-resolve network related bugs.

Testing Your App In Various Network Conditions

Set up your proxy as described in the section above.

  1. In Charles, open up the menu “Proxy” -> Throttling Settings and you’ll see the menu.

  2. On the menu, turn on throttling on a global level, for all hosts. Or you can enable it only for select hosts.

  3. Then you can choose throttle preset through the dropdown. For example, you can throttle it to a point where it simulates bandwidth over 3G. Of course, you can also set your customized network by change parameter in the throttle configuration, like round-trip latency. (my favor is setting it to 25000000ms)

Have fun!

share|improve this answer
add comment

Charles proxy can do it, there are a number of other software and hardware solutions that give you control over network bandwidth and other network behavior such as packet loss, latency, etc. You can search for "WAN Simulator" to find some of them. If all you're doing is simulating a low bandwidth connection, like a 56k modem or something then Charles Proxy is probably fine for your needs. If you want to simulate traffic to your site hosted in the US from someone in China, then I would suggest going with one of the more full featured software or hardware solutions that gives you more control.

share|improve this answer
add comment

I believe that you can do even more with Apache JMeter.

  1. JMeter is capable of recording mobile application traffic. See Load Testing Mobile Apps. But Made Easy. guide for detailed walkthrough on how to record mobile application requests using JMeter built-in HTTP Proxy Server. Once recorded you will be able to play requests back with multiple virtual user threads.
  2. JMeter can simulate different network types. See How to simulate network bandwidth in JMeter for relevant properties and reasonable defaults.

If you don't need any load testing and just want to check application's behavior for slow network you can use Apache mod_qos for throttling.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.