Ajax crash simulation for QA testing

Our first ASP.Net MVC / jQuery product is about to switch to QA, and we are looking for a way for our QA guys to easily model bad Ajax requests (without changing application code).

A typical integration / UI testing plan might be:

  • Load the page, click the "DoStuff" button
  • "DoStuff" does not work
  • Retry DoStuff.
  • "DoStuff" successfully
  • Check application status

This is a simple test case - there will be cases with multiple failures and successes alternating. Besides “disconnecting the network cable,” I’m looking for an easy way for our guys to simulate intermittent bad server responses.

I am open to any ideas, so I will not go into too detailed information about the application configuration or its dependencies. How did you handle this?

+4
source share
3 answers

Use Fiddler and the “Answering Machine” mechanism to return bug fixes / special responses to required URL requests.

http://www.fiddler2.com/Fiddler2/help/AutoResponder.asp

+2
source

You can find or create a proxy server that will pass the testers' requests. This proxy would return accurate results (for the specific error text) or send the request to the actual server.

+1
source

A way that might require more sophisticated sysadmin'ing would be to create and use a different version of jQuery in the setup phase. Hope this should be a fairly simple configuration change.

Go to the declaration of the $.ajax function and change this to crash when you need it. You may even have jQuery to enter a button that floats on your page that will “kill” the server or make it give strange answers, simply returning the answers manually, instead of making a web request.

0
source

Source: https://habr.com/ru/post/1306275/


All Articles