13

I'm testing a Windows desktop application, that requests data from a server during certain operations. I want to make sure the application can handle all possible responses, including bad ones.

What is the easiest way to accomplish this?

Will I have to create a test server, and use the hosts file to connect to that server instead of the real server? Is there a better way?

Are there tools available that can already do this?

3 Answers 3

12

Fiddler is a great tool for this kind of testing. It is an http proxy which allows you to send a request and then "fiddle" with both the request and the response between your app and going to the server. You can make small changes to a response, or create a response from scratch to send to your app.

5
  • I agree - fiddler is a good tool to use here. May 29, 2012 at 19:35
  • And here is a good video on using Fiddler: mehdi-khalili.com/advanced-web-debugging-with-fiddler May 29, 2012 at 22:56
  • Does fiddler work with desktop applications, or is it only useful with web applications? I'm not able to get it to see the request sent by my desktop application.
    – Tester101
    May 31, 2012 at 15:16
  • It works with any http traffic from any source. If the traffic is not over http then you would need a different tool. Did you set the proxy for your app? fiddler2.com/fiddler/help/hookup.asp#Q-ConfigureApp
    – Sam Woods
    May 31, 2012 at 19:01
  • Another thing I should mention, Fiddler has an API as well which makes it useful for automating these tests if you are looking at doing that.
    – Sam Woods
    May 31, 2012 at 19:07
4

Fiddler is a great (and free) tool for this, like Sam mentioned. It accomplishes a lot for a free app and even has a few features that others don't, like changing your user agent.

I do have Fiddler installed, but when I want these kinds of tools I tend to open Charles: http://www.charlesproxy.com/

It isn't free ($50/seat), but the additional tools available are really awesome. Map Local, Map Remote, DNS Spoofing, Port Forwarding, Reverse Proxies, etc.

If you're in more of a security mindset, there is also ZAP (Zed Attack Proxy). It will do many of your normal proxy tasks as well as quite a lot of other goodies. Just be careful where you point some of the tools :)

ZAP: https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project

0

If you want an in-browser solution, you can use the Firefox addon Tamper Data. Just like fiddler, you'll be able to modify each request being made in the browser.

From the addon description:

Use tamperdata to view and modify HTTP/HTTPS headers and post parameters.

Trace and time http response/requests.

Security test web applications by modifying POST parameters.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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