Javascript: testing ajax requests

I am currently working on a heavy web client application that handles a significant amount of ajax calls. I usually check if they work correctly with the Chrome Postman plugin, but at the moment it’s getting too many calls to check and see if they just work.

In any case, in order to check and see if the calls are successful, on the contrary, you need to check one at a time? I'm new to testing, so sorry if my question doesn't work a bit.

+4
source share
2 answers

There are many testing schemes. There is Selenium , but for processing large client pages (single-page applications ...), I do not think this is the best choice. If you have a java background, this may be an option yet (although it also has api in other languages).

Javascript Testing Framework is a much better choice. Some of them are for unit tests, some for e2e tests.

Here is an extensive list .

+1
source

If you are working with jQuery: jQuery already has an event called "ajaxError" that fires as soon as ajaxRequest fails.

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

+1
source

All Articles