Part 5 – Testing Evolution Series:
How long have you been load testing? Is there anything you have taken for granted over time? For those of us users of HP LoadRunner (LR) or HP Performance Center (PC) that have been load testing so long some of us just take a lot of the VuGen scripting tool functionality for granted. I decided to get recertified recently as a way to help others in load testing while also retraining myself on the tool.
One of the funniest things about getting re-certified is watching an experienced load tester act like an old man or women when it comes to the part of the test entitled, “what’s new with LoadRunner”. You’ll start to hear things like “back in my day” or “I can remember when." I’d like to think myself as an equal opportunity person, and I’d like to take the opportunity to pick on a newbie to the Load testing profession. A while back I trained a good friend on LoadRunner. He walked up to me one day and said, “Hey Michael, I'd like to ask some questions about this scripting tool VooGen”. From that moment on I can’t help but think of LoadRunner as some type of taboo tool. After all, when running LoadRunner on UNIX you have to create daemons before it starts running. When starting with HP LoadRunner there are a couple of items to you to get familiar with:
- Understand the HP LoadRunner main components
- Which protocol to pick?
- Leverage the step-by-step guide: Instructional task bar
- Understand the HP LoadRunner main components
VuGen (Virtual User generator): In order to simulate transactions, it is necessary to create scripts for it. The HP LoadRunner scripting tool is called VuGen. It enables you to record and edit a variety of user transactions, each suited to a particular load testing environment or topology. This results in a specific type of user script. This component also allows the user to insert:
- Checkpoints, checks the response from the server or application to confirm that your test performed the actions correctly.
- Transaction timing, represents an action or a set of actions that you are interested in measuring
- Parameters, are often used when the application needs unique data, data dependency, data cache, or date constraint.
Controller and Load Generator: Once transactions are ready to be simulated, you will need to create the user scenarios and execute them. The user scenarios will simulate the users’ behavior within the application. For example:
The component to execute the transactions based on users’ behavior is called the controller. Using the controller, you can control all the virtual users (known as Vuser) in a scenario from a single workstation. This tool will execute your test, and after the run collects all the information you will need for later analysis. The controller distributes each Vuser in the scenario to a load generator (some time called a host or the work horse). The load generator is the machine that executes the Vuser script. Most of the Vuser operate as a single thread process, enabling a single server or computer to emulate the actions of if several 100 users.
The controller includes monitoring and it is integrated with Sitesope (HP monitoring solution) and HP Diagnostics (profiler solution). I will talk more about these solutions in future blogs.
Analysis: To view a detailed summary from the results after test execution, you can use one or more of the analysis tools which take the Vuser logs and create a detailed report of a single run or can compare executions of the same test.
Protocols Acts as a communication medium between a client and an application under test (AUT). When selecting one of LoadRunner current 51 protocols you should understand that application behavior may drastically change based on the protocol you select, which in turn may give faults or questionable results.
- One way to learn which protocol to use is to use the Protocol Advisor located under the file menu. This will help you determine an appropriate protocol for recording a Vuser script.
*Note: the Protocol Advisor tool is only a reference tool. My suggestion is to always run the tool several times before deciding on a single protocol.
- An older school type of discovery tool is to use the Winsock protocol for the first recording if the protocol is unknown. I only recommend Winsock protocol for very simple scripts or as the discovery tool to find the proper protocol for the application under test (AUT). Winsock records at the basic system instruction level, which can help discern the proper protocol needed to record you scripts going forward. This method also allows you to see how the application is operating on the shell level. I.e. what port ranges are being used or protocol combinations.
- When learning what protocols are needed for the application under test, please make sure you check it against what protocols your company owns.
i. An example of this: Let’s say your company owns 500 licenses of Web and Multimedia protocol but you recorded your scripts with web 2.0 protocol to execute the test.
If you had realized this early in the game, you could have saved time and energy. You need to understand that you can only record the test in the protocols your company owns. With that in mind, please keep reading this article, which may give you hints on the ability to use another protocol or tools to complete load testing on AUT. (Here in Texas, we have an old saying, "There is more than one way to skin a cat" or for the vegetarian reading this, “There are several ways to peel a potato”)
3. Use the step-by-step guide: Instructional task bar
For the first few times working with a new application, I would highly recommend using the instructional task bar found on the left-hand side of the screen. This step-by-step guide will aid your work with the application and accomplish the goals of successful load testing. The task screen acts as scripting wizard for the four key steps of load testing which will make your script stable and reusable. See the steps below:
- Recording – if the tool is setup to record correctly, VuGen will automatically open your application as well as a floating toolbar and begin recording your actions. Then you perform the desired business processes you want to record. I would highly recommend that while recording, use the toolbar to insert transactions, rendezvous points (which instruct a script to wait during test execution for multiple scripts to arrive at a certain point, in order that they may simultaneously perform a task), and comments whenever possible. In addition, remember to put natural pauses in your scripts; this allows VuGen to automatically insert think times into the script.
- Running Replay – helps you to uncover any errors or issues that need to be addressed such as dynamic values, which need parameterization. It also provides valuable data for the correlation process which is used to handle dynamic content.
- Enhancements Step – allow the scripter to take the information learned in the replay step and aid you inserting parameters and check points. These will help you troubleshoot any questionable function found between the first and second run. This Correlation process will resolve the dynamic value into a variable thereby enabling your script to replay successfully.
- Preparing for a Load Test step – will help in preparing your script to be added to the Load Test scenario.
We have just scratched the surface of LoadRunner and scripting tool VuGen (VooGen). With the next several Blog’s I would like to step through the process and applications that make up the LoadRunner Suite of Tools. We will also start discussion around types of Load testing which should start windfall of exchange of ideas. I would like the senior citizens of load testing start posting more tips and tricks on VuGen on this blog while the youth of Load testing post their questions, suggestion and idea on this blog as well.
Other Blogs you may like:
- Putting Stabilizers in test automation and test execution?
- Defining a Project in Application Lifecycle Management or Quality Center
- Attended and unattended testing
- OOP’s is the best way to describe Business Process Testing?
- HP Sprinter - Improving Quality without Automated Testing
- Doc meeting one of the tallest men in I.T.