Load Testing an Javascript or AJAX Application - Web Performance

Load Testing an Javascript or AJAX Application

Most of us are relieved that web applications are starting to behave more like desktop applications – i.e. smarter and easier to use. A little wow factor here and there doesn’t hurt either. Ease of use always has a cost, so it should come as no surprise that the AJAX applications are more difficult to develop. But you may be surprised that they can also be more difficult to load test.

The reason is fairly simple. Traditional web applications are relatively easy to model and simulate. The state of a user session, at any given time, is a combination of the client-side and server-side state of the session. The client-side state consists of the state of the browser (i.e. cookies) and the representation of the current web page (which includes form fields and the query parameters in each link). The server-side state does not require any effort on the part of a load testing tool if the client-side state is simulated correctly. AJAX adds an entirely new dimension to the client-side state. Javascript that runs after the page loads, either automatically or in response to user actions, can change the page structure, change the value of form fields, change links etc.

Some classes of testing tools, such as functional testers, can simply control a real browser and force mouse movements and keystrokes into the browser – allowing the browser to function normally. Load testing tools, however, cannot afford this approach. Imagine trying to run 25 browsers on a single machine. Besides the fact that the performance would be a serious limitation, most browsers will share cookies, cache, etc. among multiple windows – making an accurate simulation of multiple individual users impossible.

As a result, most load testing tools simulate users at the HTTP layer – simulating the traffic that is generated by the browser, rather than simulating the entire browser. Web applications that utilize the traditional page-at-a-time design can be easily simulated with Load Tester™. Load Tester™ uses sophisticated state analysis algorithms to analyze and automatically configure the testcase so that dynamic field values (such as the _VIEWSTATE hidden fields used by the .NET framework) are simulated with little or no effort required from the tester. This is made easier by the fact that every browser submits forms using a standard format (application/x-www-form-urlencoded). Web applications that utilize AJAX methods, however can implement whatever data formats they choose to exchange information asynchronously with the server. JSON and XML are popular choices, but there are many others. While we are constantly expanding our format support and improving our analysis algorithms, there will always be testcases that require some manual configuration.

The purpose of this guide is to demonstrate an example of this configuration process using our load testing software (Load Tester™ 3.4) and a popular open-source application, KnowledgeTree. While this application is primarily a traditional page-based web application, it has some AJAX features that require custom configuration to be simulated correctly. Part 2 of this article will demonstrate a example of an fully AJAX application.

Prerequisites: This article assumes the reader is comfortable with the basic use of Load Tester™. At a minimum, you should be familiar with basic load testing concepts and the process of using Load Tester™ to record and configure a testcase. Our introductory videos and Load Testing 101 article are great ways to get started.

Read the Article

1 Comment

2 January 2013 testingwhiz

AJAX Application is very difficult to develop. Load testing an AJAX Application requires some manual configuration.

Add Your Comment

You must be logged in to post a comment.


Copyright © 2024 Web Performance, Inc.

A Durham web design company


(1) 919-845-7601 9AM-5PM EST

Just complete this form and we will get back to you as soon as possible with a quote. Please note: Technical support questions should be posted to our online support system.

About You
How Many Concurrent Users