Recently, I was teaching a class where the client was interested in HTTP load testing for which Test Complete has great support. Test Complete ships with a tool called Remote Agent that can be installed separately and allows for HTTP load testing using virtual users on multiple machines all controlled by a single instance of TestComplete. In fact, you can load test with up to 250 virtual users allowing a single tester to easily leverage an entire network of computers.
The following outlines the steps I took to demonstrate how easy it is to setup and execute HTTP load tests.
The first step is to create a new HTTP Load Test project.
- Select File | New Project
- Click the HTTP Load Testing Template
- Click Ok
- The Project Wizard appears and you can simply click Finish which will give you a project that looks like the image to the right.
As you can see the project has several nodes by default.
- Stations: represents the machines that will be conducting the tests. Master is my current machine, the one I’m running TestComplete on.
- Tasks: is the HTTP traffic you’re interested in testing.
- Tests: allows you to assign tasks to various stations for test execution.
- Scripts: is for manually writing test automation.
Setting up Remote Agent
For this example, I’m using a virtual machine running Windows XP. I’ve installed TestComplete 6.0 and I’m running Remote Agent which runs in a console window on the desktop. If you’re going to try and duplicate my setup be sure that your VPC network adapter is not set for Shared networking (NAT).
- Right click the Stations node and select Add New… (you should see the dialog to the right)
- Enter the IP address of your Remote Agent machine, in my case that’s 192.168.1.104.
- Click Ok
This will give you a new node under Stations, “VPC” which is your VM, or the machine running Remote Agent.
Record an HTTP Task
The next step is to create the HTTP traffic you want to load test your server and the easiest way is using TestComplete’s recording facilities. For HTTP load testing this requires setting TestComplete to be a proxy for your web browser.
- Configure Internet explorer to use TestComplete as a proxy allowing it to monitor and record HTTP traffic. For IE you can do that from the Connections tab of the Internet Options dialog setting the proxy to localhost on port 9999. For Firefox open the Tools|Options dialog and look on the Advanced page, under the Network tab.
- Click the record button on the TestComplete toolbar and once recording begins click the “Record and HTTP Task” button (circled in red below):
- This will bring up the Select Load Testing dialog where you can decide to record a new HTTP traffic or append it to an existing task.
- Once you click OK you can begin recording HTTP traffic by simply using your browser. TestComplete will record the HTTP traffic and add it to the task you specified.
Once recorded you can modify the web requests to fit your needs. Here is an example of what the recorded HTTP traffic looks like:
Running HTTP Load Testing
The next step is to configure individual Stations to perform the Tasks you’ve created. To execute your tests, TestComplete sends the recorded HTTP traffic to the web server bypassing the browser which means clients hosting Remote Agent will have no UI appear on screen other than the agent itself.
As you can see I’ve configured one virtual user to sent HTTP traffic starting half a second after the Master with a User-Agent of IE6.
Running HTTP Load Testing
The final step is to run your HTTP load tests and examine the output. To do that you can simply right click your test under the Tests node in the Project Explorer. The results at first will appear overwhelming but undoubtedly provide you with a detailed report of how you server performed.
As you can see TestComplete makes it quick and easy to create and run HTTP Load Tests so if this is something you’re looking for you might want to give it a try.
[UPDATED: Jan, 17 2008] Fix a few typos, and clarify adding a new Stations node.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.