Working with LoadRunner
When testing or monitoring an environment, you need to emulate the true behavior of users on your system. HP testing tools emulate an environment in which users concurrently work on, or access your system. To do this emulation, the human was replaced with a virtual user, or a Vuser. The actions that a Vuser performs are described in a Vuser script. The primary tool for creating Vuser scripts is the Virtual User Generator, VuGen.
Vusers emulate the actions of human users by performing typical business processes in your application. The actions that a Vuser performs during the recording session are described in a Vuser script.
Using VuGen, you can run scripts as standalone tests. Running scripts from VuGen is useful for debugging as it enables you to see how a Vuser will behave and which enhancements need to be made.
Steps for Creating Scripts:
VuGen enables you to record a variety of Vuser types, each suited to a particular load testing environment or topology. When you open a new test, VuGen displays a complete list of the supported protocols.
To start VuGen, choose Start > Programs > <App_Name> (for example LoadRunner) > Applications > Virtual User Generator from the Start menu.
To open an existing script, not in the recent list, click Open Existing Script. To create a new script using a recent protocol, click the protocol in the Recently used protocols list.
To create a new script in a protocol that is not listed, click New Vuser Script.
Choose File > Zip Operations > Import From Zip File … to open an existing Script from a zip archive.
Now click on the New Protocol Script and you will see the following Window. From this window you have to choose the protocol on which the application you are going to load test works.
VuGen provides a variety of Vuser technologies that allow you to emulate your system. Each technology is suited to a particular architecture and results in a specific type of Vuser script. For example, you use Web Vuser Scripts to emulate users operating Web browsers. You use FTP Vusers to emulate an FTP session. The various Vuser technologies can be used alone or together, to create effective load tests or Business Process Monitor profiles.
Now set the General options for VuGen.
For Example To set the environment-related options:
Select Tools > General Options and click the Environment tab.
To save the current script information for auto recovery, select the Save AutoRecover Information option and specify the time in minutes between the saves.
To set the editor font, click Select Font. The Font dialog box opens. Select the desired font, style, and size and click OK. Note that only fixed size fonts (Courier, Lucida Console, FixedSys, and so on) are available.
To use a comparison tool other than WDiff, select Use custom comparison tool and then specify or browse for the desired tool.
Click OK to accept the settings and close the General Options dialog box.
Now Set the Recording Options for recording the user actions of the application under load test.
Give the Url of the application that needs to be load tested like the one below
The following table describes the criteria for determining the business functions or processes to be included while recording
Now record the transaction in either Vuser_init or Vuser_end or action by using the recording tool bar.
Once the recording is over a recording log is also generated