5

I am currently working on a heavy client side web app that handles a considerable amount of ajax calls. I usually check to see if they calls work properly with the chrome plugin Postman, but at this point its becoming too many calls to check and see if they are simply working.

Is it anyway to test and see if the calls are coming back successfully opposed to having to check one at a time? I'm new to testing so sorry if my question is a little off.

  • How about a unit testing framwork like [QUnit](http://qunitjs.com/)? – Mark Meyer Dec 31 '12 at 20:43
  • Have you looked into just taking a peek at the network tab in chrome's developer tools? You should be able to see the result of every ajax call that the web app made. – Joseph Yancey Dec 31 '12 at 20:45
  • mind giving some examples for my situation? I been searching through the different testing frameworks and hasn't found the exact answer to my question. –  Dec 31 '12 at 20:45
  • @Joseph Yancey: at this point thats still not enough since some calls depends on others –  Dec 31 '12 at 20:46
  • [Firebug](https://getfirebug.com/) is a very nice extension for viewing AJAX requests. – Supericy Dec 31 '12 at 21:12

2 Answers2

1

There are lots of testing frameworks. There is Selenium, but for heavy client side processing (single page apps, ...), I don't think that is the best choice. If you have a java background, it might be an option still (although it also has api's in other languages).

Javascript testing frameworks are a far better choice. Some are for unit tests, some for e2e tests.

Here is a extensive list.

Community
  • 1
  • 1
asgoth
  • 35,552
  • 12
  • 89
  • 98
1

If you work with jQuery: jQuery already has an event called "ajaxError", which is triggered as soon as an ajaxRequest is not successful.

For more information: http://api.jquery.com/ajaxError/

atreju
  • 477
  • 4
  • 14