LoadRunner is a load test tool that predicts the behavior and performance of the system. LoadRunner is able to test the entire enterprise architecture by identifying and locating problems in a way that simulates the concurrent load and real-time performance monitoring of tens of thousands of users. Enterprises use LoadRunner to minimize test time, optimize performance, and accelerate the release cycle of application systems. The LoadRunner can be used for automated load testing of various architectures to predict system behavior and evaluate system performance.
LoadRunner is a good test software, but I found very little information when I was using it, so I decided to record some of the processes I used.
First download LoadRunner12 (currently the latest version) and install it on the HP website, you can see the following 3 programs on the desktop after installation:
- Vugen for recording scripts and creating virtual users in Scripts
- The controller assigns the virtual user to the created scene for testing
- Analysis can show and generate some chart data after the results of the scene are counted
This chapter focuses on the process of recording scripts using Vugen
- Open Virtual User Generator and click File-new Script and solution to create a new script
- Choose how you want to record the interaction, and here's an example of the HTTP protocol, and then a script name click Create Creation Script
- The initial script will have 3 actions, where Vuser_init will run when the virtual user is created, Vuser_end will run when the virtual user is destroyed, the two actions will run only once, and the action will run in the lifetime of the virtual user and can run multiple times
- Click Record-record to start recording the script
- Record into action select the action in which to record the event LoadRunner provides 3 ways to record scripts (for Web sites), desktop program recording (for local programs or Android emulator), Agent recording (for mobile phone real machine)
- First Test the Recording browser, select Record-web browser,application Choose the default IE, URL address Select the address you want to record, and then click Start Recording begin recording
- Start recording will automatically open the URL you want to record, and pop up a toolbar, the toolbar includes start/end/pause recording, Save as action, add transactions and other common operations, at this time after the browser operation needs to record the action to click on the stop recording, The corresponding code for the action will appear in the corresponding action.
- The method of recording the desktop program is similar to the browser, first select Record-windows application,application to select the program that needs to start program arguments select the parameters required by the launcher, Here's an example of an Android simulator
- Agent Recording Select Record-remote application via LoadRunner proxy, listening port Select a port that is not occupied
- Agent recording requires the phone and computer under the same LAN, turn on the phone's network settings, change the network connection to manual DHCP, and fill in the listening computer IP and port number, Android and iOS are set separately
- After recording the script, you also need to process the script, first you can use Replay-run to verify the script is correct, in the script can also add the following code to make the script more realistic:
- Lr_think_time: Pause script to simulate user think time
- Lr_rendezvous: Sets the collection point so that the user can continue running after this point collection
- Lr_start_transaction: Opens a transaction that wraps multiple operations of a behavior uniformly as a transaction for that behavior
- Lr_end_transaction: Closing transactions
The above is the whole process of recording scripts with Vugen, then we will introduce the scenario of using controller to create a running script and analyze the result of running the script with analysis.
Ps:loadrunner will provide a test site after installation, which can be run locally via the Start HP Web tours application, and then HP Web Tours application opens the test site.
[LoadRunner] First knowledge of LoadRunner12 Vugen