LoadRunner Training Beginner's tutorial

Source: Internet
Author: User

A brief introduction to LoadRunner

1.1 LoadRunner Introduction

LoadRunner is the HP Mercury Interactive tools to test application performanceLoadRunner load test an application by simulating a multi-user environment that works in parallel. By using a minimal amount of hardware resources, these virtual users provide consistent, repeatable, and measurable workloads that use the applications they want to test, just like real users. LoadRunner in-depth reports and graphs provide the information needed to evaluate application performance. 1.2 loadrunner application Load TestThe modern system architecture is complex. These systems are also difficult to test while providing unprecedented power and flexibility. Single-user testing focuses on the functionality and user interface of the system components, while the application test focuses on the performance and reliability of the entire system. For example, a typical application test scenario might be that 1000 users logged on to the system at the same time in the morning of Monday. What is the response time of the system? Will the system crash? To answer these questions (and more questions), a complete application performance testing solution must: Ø Test a system that combines a variety of software applications and hardware platforms Ø determine the suitability of the server with any given application ø before developing the necessary client software to test the server Ø Simulate the environment of interaction between multiple clients and a single server application ø in dozens of, Test the application under load of hundreds of or even thousands of potential users 1.3 LoadRunner SolutionsVloadrunner replaces actual users by using virtual user VUser. These vuser simulate the behavior of the actual user-running the actual application. V because many vuser can be run on a single computer, LoadRunner reduces hardware requirements. Vloadrunner controller can control all vuser simply and effectively from a single control point. Vloadrunner Monitor the performance of your application online. Vloadrunner automatically records the performance of the application during testing. Vloadrunner can check where performance delays occur: Network or client latency, CPU performance, I/O latency, Database locking, and other issues on the database server. LoadRunner will monitor network and server resources to help improve performance. two LoadRunner test processØ Develop load test Plan Ø Develop test script Ø Create run scene Ø Execute Test Ø Monitor scene Ø analysis test results LoadRunner Component Introduction   LoadRunner contains many components, the most common of which are Visual User Generator (hereinafter referred to as Vugen), Controller,analysis. V Mercury Virtual User Generator (Vugen)-Create scripts Vugen generate virtual users by recording actions performed by typical end users in the application ( VUser)。 Vugen these actions into the automatic virtual user script, which is used as the basis for the load test. The V Mercury loadrunner controller-Design and run scenario controller is the central console used to create, manage, and monitor load tests. You can use a Controller to run scripts that simulate the actions performed by real users and to create a load on the system by having multiple VUser (virtual users) perform these operations simultaneously. V Mercury analysis-Analysis Scenario Mercury analyses provides graphs and reports that contain in-depth profiling information. Using these diagrams and reports, you can identify and identify bottlenecks in your application and determine what changes need to be made to your system to improve system performance. to develop a script using Vugen:Ø Record Test script Ø Perfect test Script Ø configuration Run-time Settings Item Ø Stand-alone run test script Ø Create run scenario

Use Vugen Development Script - recording test scripts

Click StartMercury loadrunner->applications->virtual User Generator or StartMercury loadrunner-> Mercury loadrunner->load Testing->create/edit scripts to start Vugen.

After starting Vugen, you can choose to create a new single protocol script, multi-protocol script, open script, etc., if you do not want to display the page next time, in the "T show Thestartup Dialog in the" before the future tick. Use Vugen Development Scripts - Recording test ScriptsCreate a new user script, select the protocol for the system communication, here we need to test the Web application, so we need to select the Web (http/html) protocol, OK, after entering the main form. Set recording OptionsO Application TypeSelect the application type in Internet ApplicationO URLEnter the URL to test in O working DirectorySet the working directory in the Ørecord into Action Select the section to which you want to place the recorded script, see action Vthe scripts in Vugen are divided into three parts: Vuser_init, Vuser_end, and action. where Vuser_init and vuser_end can only exist one, can not be split, and action may also be divided into numerous parts (by clicking the New button, new actionxxx)V"Record the application Startup" is selected by default, indicating that once the application is started, Vugen will start recording the script, and if it is not selected, Vugen will appear to the right dialog box after the application starts, and the recording script is not started. The user operates the application to the place where it needs to be recorded, press the "Record" button, and Vugen starts recording.

  Introduction to the recording tool stripDuring the recording process, a toolbar appears on the screen. Let's take a brief look at the functions of each button:

When the recording is complete, press the end recording button to Vugen automatically generate user scripts to exit the recording process. View ScriptsAfter recording, there are two ways to view the script: script View and tree view Ø Script ViewThe V Script view is a text-based view that lists the VUser operations as API functions. To view the script in the script view, click the View Script button on the toolbar or choose View > View script. V in script view, Vugen will display a script with color-coded functions and their variable values in the editor.

O tree ViewThe V-tree view is an icon-based view that lists the VUser actions as steps. To view the script in the tree view, click the View Tree button on the toolbar or choose View > View tree. V for each step performed during recording, Vugen generates an icon and a caption in the test tree. In the tree view, you will see the user action as a script step. Most of the steps come with a corresponding recording snapshot.

Use Vugen Development Scripts - Perfecting Test Scripts TransactionsAfter recording a basic user script, we also need to complete the test script before formal use, to enhance the flexibility of the script. For example, you can insert a step in the script called content checking to verify that certain content is displayed on the return page. Scripts can be modified to simulate multi-user behavior, and transactions can be used to measure specific business processes. Transaction (Transaction): In order to measure the performance of the server, we need to define the transaction. For example: We have a data query operation in the script, in order to measure the performance of the server to perform the query operation, we define this operation as a transaction, so that when the test script is run, when the LoadRunner run to the start point of the transaction, it will start the timing until the end of the transaction to run, the timing ends.  The run time of this transaction is displayed in the results. The Insert transaction action can be performed during recording or after the recording is complete. LoadRunner Run inserts an unlimited number of transactions in the script. methods for inserting transactions

The start point of the transaction before the operation that requires the definition of a transaction is inserted through a menu or toolbar.

Enter a name for the transaction. Note: The name of a transaction is best to make sense and to clearly describe the action that the transaction completedafter inserting the start point of the transaction, Insert the end point of the transaction after the operation that needs to define the transaction . You can also insert from a menu or toolbar

By default, the name of the transaction lists the most recent transaction name. In general, the transaction name is not modified. The state of a transaction is Lr_auto by default. In general, we do not need to modify it. third, the use Vugen Development Scripts - single-machine run test scriptThe run script can be manipulated by a menu or toolbar:After executing the Run command, Vugen compiles the script to check for errors such as syntax. If there is an error, Vugen will prompt the error. Double-click the error prompt, Vugen can navigate to the line where the error occurred. If the compilation passes, it will start running. The result of the run will then appear. Iv. Use of Controller Create a scene - New Scene Window Introduction The LoadRunner scenario can describe various events that occur in a test activity . A scenario includes a running virtual User ActivityList of load Generator machines, a list of test scripts, and a large number of virtual users and virtual user groupsClick StartMercury Loadrunner->applications->controller or StartMercury loadrunner-> mercuryloadrunner->load Testing->run Load tests to start the controller program. In the New Scene window, select a scene type: vmanual Scenario: Fully manual Setup scenario ( 1) vmanual Scenario with Percentage Mode ( 1.1): This item can only be selected if "Manual Scenario" is selected. After selecting the item, in the scenario we need to define the total number of virtual users to use, Load Generator machine set, and then we assign each script a percentage of the virtual users to run. Vgoal-oriented Scenario ( 2): In a test plan, the goals that the performance test is intended to achieve are generally included. After selecting the item, LoadRunner automatically creates a scene for you based on this goal. In the scene, we just define our goals. Iv. Use of Controller Create a scene - Controller Overview of the design windowThe Design tab of the Controller window contains two main sections: Scene plan and scene groupV Scenario Plan:In the Scenario Planning section, you can set the load behavior to accurately depict user behavior. You can also determine the rate at which the payload is applied to the application, the duration of the load test, and how to stop the load. V Scene Group: You can configure the VUser group in the Scene groups section. In this section, you can create various groups that represent typical users of your system. You can define the operations that these typical users run, the number of VUser to run, and the computers that are used by the VUser runtime. Iv. Use of Controller Create a scene - Controller Run Window OverviewThe Run tab in the Controller window is the control center for managing and monitoring tests. The run view contains five main sections: Scene group, Scene state, available tree, Chart view area, and legend. V Scene Group: In the upper left pane, you can view the status of VUser in a scene group. Use the buttons on the right side of the pane to start, stop, and reset the scene, view the status of a single vuser, and add more vuser manually to increase the load on the application during the scene run. V Scene state: In the upper right pane, you can view a summary of the load test, including the number of VUser running and the status of each vuser operation. V Available tree: In the middle left pane, you can view a list of LoadRunner charts. To open a diagram, select a diagram in the tree and drag it to the view area of the diagram. V View area: In the center right pane, you can customize the display to see one to eight graphs (View > View Graphs). V legend: In the bottom pane, you can view the data in the selected diagram.

Iv. Use of Controller creation scenario - run controller

Open it ControllerRun the view. Click the Start Scenario button or select Scenario, Strart to start the test run. If you run the scene for the first time, the Controller launches the scene. The resulting file is automatically saved to the temporary directory of the load generator. If you want to repeat this test, you will be prompted to overwrite the existing result file. Click No to specify a new result directory. Enter a unique and meaningful name for each result set, because you might want to overlap the results of several scenes when you parse the diagram.

v. Use of Analysis Analysis Results - Analysis Window Overview

The graphs and reports generated during an analysis session provide important information about the performance of the system. Using these diagrams and reports, you can easily identify and identify bottlenecks in your application and the improvements that are required to improve system performance. From analysis, we can get the transaction response time of the user terminal, the average response time of the transaction, the response time of the network and the server. From StartMercury loadrunner->applications->analysis or StartMercury Loadrunner->mercury loadrunner->loadtesting->analyze Load tests to start the analysis program.

LoadRunner Training Beginner's tutorial

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.