Url Redirector Modified

Load Testing Tools - Quick Start and Tips

Need for a tool

Load is a one of the performance factor which affects the performance of the application and the number of users contributing it. It is very tedious for large number of users to sit and access the application to simulate the load. This involves human resources, hardware resources, cost, space, co-ordination etc. More over it is very difficult to repeat the same test. The solution is an automated tool. Tool can simulate the load and can be used to repeat the same test multiple times.


Get Started with Load Test Tool

Following are the quick steps in getting started with the load testing tool..

Step 1- Script Recording

oCritical transactions to be load tested
oStep by step navigation of the transaction

§Capture the client-server traffic  while navigating the steps for critical transactions
oTraffic can be of low level data like TCP/IP or high-level data like HTTP
oLoad Test tool capture the traffic in readable format which is called script

oFor middleware client-server traffic may not be able to capture. So in that scenarios, it has to be coded manually in the testing tool

To understand how script recording works, it is important to to know little bit more about the components of web pages. The web page is a combination html pages and other resources like gifs, jpegs, and swfs. When a user key in the URL, browser will parse server response and internally request for all other resources. If there is a change in the image, browser will detect this while parsing and request the latest one. This is a run time activity and it is dynamic. The client side script will be used for many other purposes. The tool will capture the traffic between the client and server and convert in to readable format called scripts. Some of the tools will record the low level traffic like HTTP headers and body, some will record end user actions like clicking the hyperlinks. The low level recorded scripts are static scripts. That means if there is a change in the web page, you may need to capture the script again.  If the script records end user actions, mostly they are dynamic scripts. If there is a change in the web page and it will be handled by the script while play back. The bottom line to to understand whether script is dynamic or static. In LoadRunner HTML based scripts are dynamic whereas URL based scripts are static.

Most of the load testing tools does not simulate the client side scripts. If the client side scripts are used for form validation, it is not a problem. But if the client scripts are doing something like setting up cookies or encryption, this has to be handled manually in the load testing script during customization.


Step 2- Script Customization

oData - unique usernames, values changing dynamically with respect to each user
oThink time between each user actions

 §Customize the recorded script to simulate multiple users with one script

Once the script is recorded, without doing customization it can not be used to simulate multiple users. Also, testing will not give realistic results if we use the recorded script as is. So the recorded script needs to be customized to replay for multiple users.  Consider the fund transfer transactions in an Online Banking application. Same script can be used to simulate the multiple users doing the fund transfer. Recorded script will have only one user name and one account name. If this is used for simulating 10 users, it will use same user id for 10 virtual users and do fund transfer for same bank account. It will never happen in real time and will also give un-desired results like deadlocks, poor performance etc. The solution is to use a variable for user name and account number. This technique is called parameterization. Identifying the values and parameterizing them is very essential to do realistic load testing. End user will spend some amount of time in each and every screen. The load scripts are automated scripts which can be run without having any delay time between the user actions. Also if the scripts are run without this delay, it will simulate unrealistic load on the server. Here comes the think time or sleep time. It needs to be introduced between recorded user actions to simulate end user behavior. Most of the web applications use browser cache to improve the performance. Most of the load testing tools will have options to configure the browser options.  By default, tools may not simulate the browser cache. Setting up browser cache needs to be configured while customizing the scripts.

Step 3- Test Execution

oNumber of users
oDistribution of users among critical transactions

 §Execute the test
oSetup scenario  in the tool based on the numbers of users
oSetup monitors to measure server side statistics like CPU, JVM Heap etc..
oExecute the test from Load Generators
oResult will be saved in the Load Test tool itself

Step 4- Reporting

oNon Functional Requirements & Service Level Agreements
oTest Results
§Analyze & Prepare the Report

Where to start the learning of Load Test tool?

Everyone start with Tools when they start performance testing. Is it enough? To stand out of the crowd, you need to learn more than a tool. What do we need to learn? Learn how tools simulate the applications. Detailed discussion on the tools can be found at another section. The following are some of the key topics which can be considered for learning other than the tools.

What to begin with?

Web applications and HTTP: 
How does web browser show the web page? You just type the web page URL in the address bar. And it shows up the web page. Does it look so simple? It looks simple for the end user, but it is not simple. Internally the web browser sends the URL request to the server using the HTTP.  The server responds to this request using the same protocol. As a performance tester, you need to understand how HTTP protocol works. This will give you an understanding how tools simulate this.  Just to start the learning, HTTP request (what you make) and HTTP response (what server gives) has a header and body. Header contains the information of the request and response, the body contains actual request and response. Some of the performance testing tools will even record the Header and Body in the script itself. Example: Open STA. But some of the tools will record only the user actions in the script, but simulates the headers and body behind the screen. Example: LoadRunner. Whatever may be the tool; the understanding of HTTP gives an edge and helps to debug the web scripting issues.


Java Script, VB Script and Applets:

The client side scripts are used to do processing at the client side. These are programs running within the web browser. The some of the commons functionalities are Form validation, Encryption, setting up cookie values.  Most of the tools simulate the processing on server side and do not simulate the client side programs. So it is important to learn how these programs work. It will help to simulate the functionalities done by these client side scripts.


Importance of Cookie:

Next thing you need to understand is Cookie. Many times you forgot to logoff your GMail in your own PC. Didn't you? Have you noticed that, accessing the mail will take you to inbox without login. How does your computer know that you did not log off? The answer is Web Cookies. To be specific, it is called Session Cookie. You will get tons of details to read about these, so I leave this for your exploration.

Browser Cache and Performance:

Have you ever observed that accessing a web page second time in a computer is faster than accessing it for the first time. Web page is displayed faster on second visit. It is due to Browser cache. It is nothing but saving the web page contents locally in your own machine. Don't you think, you need to learn about Browser cache? If you dont know Browser cache, how will you know your tool simulates that?
So learn about browser cache and how it improves the performance of web based applications. Once you know that next step should be to learn how your tool simulatest the cache.

Web/App/DB Servers

Most of the topics discussed above are related client side of the application. Processing is done at server side in modern world applications. In most of the web applications, there will be a Web Server, Application Server and Database Server.  Understanding basic functionalities of these servers are very important for Performance Tester. In simple terms, web server can serve web page. It can not do processing of a dynamic web page.
Example: IBM Http server, Apache web server. On the other hand, Application server is more than a web server. It can serve web page, dynamically process web pages like jsp, asp, connect to database server, manage transactions. Example: IBM Websphere, BEA Weblogic, IIS. Database server is nothing but a server saves and manages the data.


Performance Testing Fun