There seems to be a lot of stress/load testing tool that support AJAX.
I am wondering how well does these tool implemented.
Do they only record http request and replay it?
Is it the right way to test AJAX app?
How does google test their ajax apps?
Take a look at LoadBooster(https://www.loadbooster.com). It utilizes headless scriptable browser PhantomJS/CasperJs to test web sites. Phantomjs will parse and render every page, execute the client-side script. The headless browser approach is easier to write test scenarios to support complex AJAX heavy Web 2.0 app,browser navigation, mouse click and keystrokes into the browser or wait until an element exists in DOM. LoadBooster support selenium HTML script too.
Disclaimer: I work for LoadBooster.
I've used Virtual User Generator, which is a part of the Loadrunner software from HP, to test AJAX applications. The software has several application protocols that can be used to record web applications, e.g. AJAX, and Click and Script.
For the majority of web application load testing it is sufficient to record and replay http requests. This will give the result of how the servers are handling the load. If your web application does a lot of asynchronous loading, and rendering on the client side, e.g. parsing large datasets of xml or json, or many DOM modifications, it can be relevant to include the browser tier to measure the end user experience.
Most of the load testing tools out there do AJAX load testing the same way: they execute the raw HTTP traffic that is seen during a "recording" phase (which can be page requests, image requests, or even AJAX requests). The main difference among them is how good their recorder/IDE tool is and how easily it helps you parameterize the HTTP requests such that they reflect real world traffic based on dynamic/realtime results.
Warning, blatant plug: The only real exception to this is my company, BrowserMob. Instead of simulating the traffic observed, it actually uses real web browsers to drive back load. As such, the AJAX stuff is handled by the browser.
Useful link: Separate from the blatant plug above (though I do hope you check it out - we're up front with the pricing and provide a free trial), I recently wrote an article for Ajaxian about AJAX load testing. It goes in to more detail about the technical implications of using real browser users (RBUs) vs. virtual users (VUs).
Better write isolated test method or API for load testing ajax application. There are some reasons:
You can devide your testing like that: for Ajax application use Selenium or PhantomJS/CasperJS. For load testing use JMeter, Gatling via API not via Ajax.
Google apps are written in GWT, which comes with its own extension to JUnit. Article on unit testing ajax applications with GWT.
I've used SilkPerformer at a previous job. According to the link, they have some AJAX enhancements. Unfortunately, Silk is far from free.