Hp loadrunner tutorial pdf download

















Below is a sample of how the scenarios would be laid out. We will discuss correlation in a subsequent chapter. Review the list of ports. Connect the scripts to the test data. The active protocols being used in the script will be displayed here. You define transactions to measure the performance tutoroal your system. Once the System has been validated for its functionality during the System and Integration testing phase, performance testing is conducted.


Correlation — Configuration This is the general configuration used by the rules once the recording is complete. For such a case, navigate to Multiple Protocols list on the left side of window. This includes generating code, transactions, and comments based on your recording. This is not the case for HTML recording. VuGen works on the principle of record and playback.


Performance testing can be broken tutoriak into the following categories. He is the main stakeholder for any escalations. VuGen — The Loadeunner component is used to simulate the exact business transaction within your applications. Infrastructure team — Ensure the entire infrastructure team is place to monitor the servers for the application which is being tested.


It is a good practice to analyze only one business process at a time since the various business process in a large enterprise application may involve various protocols. Keep the first option as chosen and click on the Continue button. Usually, this is the first step of scripting where every user action is recorded into a script.


The performance tests should be conducted against environments that are identical to production. Recording options in LoadRunner While recording, there are a variety of options available to the tester. Send your email to: If you have made changes to your script as per Step 2, then the script verification process is an important step. In a real world scenario, always test the business scenarios to make sure they are working as they should, before you start the scripting process. The list looks slightly different from previous versions 1.


VUGen will create one. Start a transaction by clicking button in floating bar. The Controller is used to manage these agents. How to insert Comments Comments can be inserted at any point during the recording session. Filter the results. You can filter the Test Tree pane to display a specific iteration or status. For example, you can filter it to show only Failed status. The Filters dialog box opens. Under Status, select Fail and clear all the other options. Under Content, select All and click OK.


The left pane becomes empty, since there were no failures. Close the Test Results window. Sometimes a replay will fail, even though the recording of the same actions succeeded. Many applications use dynamic values that change each time you use the application.


For example, some servers assign a unique session ID for every new session. When you try to replay a recorded session, the application creates a new session ID that differs from the recorded session ID. Dynamic values, such as these unique session IDs, may pose difficulties when you replay specific types of Vuser scripts. LoadRunner use correlation to address the issue of dynamic values. Correlation saves the changing values, in our case the session ID, to a parameter.


When running the Vuser script, the Vuser does not use the recorded value—instead, it uses the new session ID, assigned to it by the server. In this lesson you will cover the following topics: l Preparing HP Web Tours for replay errors l How do I work with unique server values? A browser opens with the HP Web Tours home page. Change the server options.


Click the administration link on the HP Web Tours home page. The Administration Page opens. This setting tells the server not to allow duplicate session IDs. Scroll down to the bottom of the page and click Update. Scroll down to the bottom of the page and click the Return to the Web Tours Homepage link. If you try to replay the unmodified Vuser script that you recorded in "Lesson 1: Building a Vuser Script" on page 12, the replay will fail. To overcome this issue, you use VuGen to detect the need to correlate the session ID.


You will instruct VuGen to insert a step that saves the original session ID to a parameter. In each subsequent replay session, VuGen saves the new unique session ID to a parameter. As the Vuser executes the steps in the Vuser script, the Vuser uses the saved session ID value instead of the originally recorded value.


Record a new Vuser script with dynamic values. Record a new Vuser script with the same steps that you recorded previously in "Lesson 1: Building a Vuser Script" on page Replay the new script. VuGen runs the new Vuser script.


You may notice several error messages in the Replay Log in the Output pane, indicated by the red-colored text. View the Replay Summary. Look at the Replay Summary tab. The summary shows that the replay of your script failed.


Scan the script for correlations. In the Replay Summary tab, click the correlate link. The Design Studio opens. The Correlation tab of the Design Studio lists three dynamic values that may require correlation. The longest of the three values is the Session ID. Correlate the Session ID.


The new function saves the original session ID to a parameter. When the Vuser runs, the Vuser uses the saved ID value instead of the originally recorded value. Click Close to close the Design Studio. Examine the syntax of the correlation statement.


Play the script again. When the replay ends, look in the Replay Log in the Output pane. Notice that VuGen no longer issues the red-colored error messages. VuGen places the cursor at the corresponding line in the Replay log. On the HP Web Tours home page, click the administration link. The next step is to prepare the script for load testing.


How will the system work with many users working simultaneously? Will the system slow down to an unacceptable level? In this lesson you will learn about different methods to enhance the script and to make it more effective for the load testing process. In this lesson you will cover the following topics: l How do I measure the duration of a business process? How do I measure the duration of a business process? When preparing an application for deployment, you need to measure the duration of specific business processes—how long does it take to log on, book a flight, and so on.


Each business process is normally made up of one or more steps or actions in your script. In a Vuser script, you designate a series of actions you want to measure by including these actions in a transaction. When you run a Vuser script that includes a transaction, LoadRunner gathers information about the time it takes to perform the transaction, and displays the results in color-coded graphs and reports.


You use this information to help determine if the application meets the performance requirements. You can manually insert a transaction anywhere in a Vuser script. In this section you will insert a transaction into your script to measure the amount of time it takes for the user to find and confirm a flight. To insert a transaction into a Vuser script: 1. If it is still open, you can select the tab displaying its name.


Otherwise you can open it from the File menu. Click the Step Navigator tab to display the Step Navigator. Insert a start transaction marker. The steps Toolbox appears in the right pane. The Start Transaction dialog box opens. Insert an end transaction marker. In the Step Navigator, locate the step Submit Data: reservations. Double-click the Submit Data: reservations. The End Transaction dialog box opens. How do I emulate multiple users? In your emulation, you tracked a user booking a flight and choosing an aisle seat.


In a real-life setting, however, different users will have varying preferences. To improve your test, you need to check if the booking will work when users select different seating preferences Aisle, Window, or None. To accomplish this, you will parameterize the script. This means that you take the recorded value, Aisle, and replace it with a parameter.


You will place values for the parameter in a parameter file. When you run the script, the Vuser will use values from the parameter file Aisle, Window, or None thereby emulating a true travel agency environment. To parameterize your script: 1. Find the section where you want to vary the data.


In the Step Navigator, locate the Submit Data: reservations. Right-click the Submit Form: reservations. The Submit Form Step Properties dialog box opens. Change the fixed value to a varying value. Click the ABC icon adjacent to the seatPref argument.


The Select or Create Parameter dialog box opens. Create a parameter. In the Parameter name box, type seat. Click OK. Specify values for the parameter. Click Add Row. VuGen adds a row to the table. Replace the word Value with Window. VuGen adds another row to the table. Replace the word Value with None. Keep the default settings in the Select column and File format sections of the dialog box. Define how the test will vary the data. Keep the default setting that instructs VuGen to take a new value for each iteration: Update value on: Each iteration.


Click Close to close the Parameter Properties dialog box. You have now created a parameter for the seating preference. When you run the load test, the Vusers will use the parameter values instead of the recorded value, Aisle.


When you run the script, the Replay log will show the parameter substitution that occurs for each iteration. The Vuser will use Aisle for the first iteration, Window for the second iteration, and None for the third iteration. How do I verify Web page content? When running a test, you often need to verify if certain content is found on a returned page. A content check verifies that expected information appears on a web page while the script is running.


You can insert two types of content checks: l Text check. Checks that a text string appears on a web page. Checks for an image on a web page. In the Step Navigator, locate the Submit Form: reservations.


On the VuGen toolbar, click the Snapshot button to display the Snapshot pane. In the Step Navigator, double-click the snapshot icon in the Submit Form: reservations. The corresponding snapshot appears in the Snapshot pane. The Steps Toolbox pane appears. The Find Text dialog box opens. When you replay the script, VuGen will look for the text Find Flight and indicate in the Replay log whether or not the text was found. At certain points during a test run, you may want to generate and send messages that contain information relating to the script execution.


You can send a standard output message or a message that indicates that an error occurred. The recommended way to work with error messages is to check for a Failed status. If the status is Failed, you instruct VuGen to issue an error message. In this section of the tutorial, you will instruct VuGen to insert an output message after the application completes a full booking. To insert an output message: 1. Double-click the Image: SignOff Button step.


The Output Message dialog box opens. In the Message Text box, type The flight was booked. Click the Save button on the VuGen toolbar to save the script.


Did the replay of my test succeed? In this section, you will run the enhanced script and search the Replay log for text checks. You will view the results of the text checks, as well as details of the transactions and parameterization. By default, image and text checks are disabled during playback since they require more memory. If you want to perform an image or text check, you need to enable checks in the run-time settings.


Enable image and text checks. Select Enable image and text check. Run the script. Click the Replay button on the VuGen toolbar. VuGen begins running the script, generating entries in the Replay log in the Output pane. Wait for the script to finish running. Locate the text check. Click the Output pane, and select Replay.


This is not the actual text check—it only prepares VuGen to check for the text after the form submission. This verifies that the text was found. If someone changes the Web page and removes the phrase Find Flight, then in subsequent runs, the output will indicate that the text was not found. Locate the beginning of a transaction. Search for the word Transaction. This notification is shown in blue. View the parameter substitution. Search for the word Parameter. Search again F3 for the next substitution.


Note how VuGen takes a different value for each iteration. In this lesson, you will evaluate your system under the load of multiple Vusers. You will emulate the actions of ten travel agents concurrently using the flight reservation system, and observe the behavior of the system under the load of these users.


To design and run this test, you use the LoadRunner Controller. Scenario Objectives In this lesson, the objective is to create a scenario that emulates the behavior of ten travel agents simultaneously logging on, searching flights, purchasing flights, checking itineraries, and logging off.


Introducing the LoadRunner Controller Load testing means testing your system under typical working conditions. For example, you may test the system while many travel agents simultaneously reserve flights on the same flight reservation system.


You design the test to emulate real-life situations. To do this, you need to be able to generate a load on an application and schedule when the load is applied because users do not log on and off the system at precisely the same time. You also need to emulate different types of user activity and behavior.


For example, some users may use Firefox to access the system, whereas other users use Internet Explorer. Users may also employ different network connections to access the system, such as modem, DSL, or cable.


You create and save these settings in a scenario. The Controller provides you with all the tools you need to help you build and run tests to accurately emulate your working environment.


How do I start the Controller? To begin developing a scenario, you open the LoadRunner Controller. Select a scenario type. There are two scenario types: A Manual Scenario gives you control over the number of running Vusers and the times at which they run, and lets you test how many Vusers your application can run simultaneously.


You can use Percentage Mode to distribute the total number of Vusers between the scripts based on a percentage specified by your business analyst. The Percentage Mode check box is selected by default the first time you start LoadRunner following installation.


If it is selected, clear it. A Goal-Oriented Scenario is used to determine if your system can achieve a particular goal. Add a Vuser script to the load test. In this tutorial, you will use only one Vuser script to model a single group of users performing identical actions. To more accurately emulate a real-world scenario with more versatile user profiles, you would create a number of different Vuser groups, with each group running several scripts with different user settings.


The script that you previously recorded in VuGen contains the business processes that you want to test. They include logging on, searching for a flight, buying a ticket, checking the flight itinerary, and then logging off the site. You will add a similar script to the scenario, and configure the scenario to emulate eight travel agents simultaneously performing these actions on the flight reservation system.


You will add two more Vusers during the test. For this purpose, a sample script is provided that is similar to the one you created.


We recommend that you use the sample script. In the New Scenario dialog box, click the Browse button. Click Open. The LoadRunner Controller opens and displays the Design tab of your new scenario. Note that the control for the Design tab is in the lower left corner of the Controller. The Controller at a Glance The Design tab of the Controller is the main interface for designing your load test.


Scenario Groups pane 2. Service Level Agreement pane 3. Scenario Schedule pane 1. Scenario Groups pane. You configure the Vuser groups in the Scenario Scripts pane. You create different groups to represent typical users of your system and specify the number of Vusers that will run, and the machine that they will run on.


Service Level Agreement pane. When you design a load test scenario, you can define goals or SLAs Service Level Agreements for the performance metrics. When you run the scenario, LoadRunner gathers and stores performance-related data.


Scenario Schedule pane. In the Scenario Schedule pane, you set the load behavior to accurately portray real-world user behavior. You define actions according to which the Vusers will run, the rates at which load is applied to the application, the load test duration, and how the load is terminated. How do I modify the script details? You modify the script details as follows: 1. Change the Group Name. The Group Information dialog box opens. The new name is displayed in the Scenario Groups pane of the Design tab.


How do I generate a load on the system? After you have added your Vuser scripts to the scenario, you configure the load generators, the computers that generate the load on the system. A load generator is a computer that runs multiple Vusers in order to generate a load on the system.


You can use a number of load generators, each generator hosting multiple Vusers. In this section, you will learn about adding load generators to the scenario, and testing the load generator connections. Add a load generator. Click the Load Generators button on the Controller toolbar. The Load Generators dialog box opens. The Load Generators dialog box shows details for the load generator called localhost.


The status of the localhost load generator is Down. This indicates that the Controller is not connected to the localhost load generator. In this tutorial, you will use your local computer as the load generator.


Note that in a typical operational system, you would have several load generators, each hosting multiple Vusers. Test the load generator connection. When you run a scenario, the Controller connects to the load generators automatically. However, you can test the connections before trying to run the scenario. In the Load Generators dialog box, select localhost and click Connect. The Controller attempts to connect to the load generator machine.


When a connection has been made, the Status of the load generator changes from Down to Ready. Click Close. How do I emulate real load behavior? After you have added your load generators, you are ready to configure load behavior. LoadRunner allows users to gradually log on to and off the system. It also lets you determine the duration of the scenario, and the way in which the scenario terminates. The scenario that you will configure below will be relatively simple.


However, when designing a scenario that more accurately reflects a real life scenario, you can define more true-to-life Vuser activity. You configure the load behavior for a manual scenario in the Scenario Schedule pane of the Controller.


The Scenario Schedule pane is divided into three sections: the Schedule Definition area, the Actions grid, and the Interactive Schedule graph. You will now change the default load settings and configure a scenario schedule.


Select schedule type and run mode. Set the scheduled action definitions. You can set the Start Vusers, Duration, and Stop Vusers actions for the scenario schedules from either the Global Schedule grid, or by manipulating the Interactive Schedule graph.


When you set the definitions from the graph, the Global Schedule grid properties adjust accordingly. You will now set the definitions so that the Global Schedule grid will look as below. Set up the Vuser Initialization. Depending on your system configuration, initializing Vusers before they start running may provide more realistic results.


Double-click Initialize in the Global Schedule grid. The Edit Action dialog box opens displaying the Initialize action. Select Initialize all Vusers simultaneously. Specify a gradual start for the Vusers Starting Vusers at intervals allows you to examine the gradual increase of Vuser load on the application under test over time, and helps you pinpoint exactly when the system response time slows down.


Double-click Start Vusers in the Global Schedulegrid. The Edit Action dialog box opens displaying the Start Vusers action. In the Start X Vusers box, enter 8, and select the second option— 2 Vusers every 30 seconds. Schedule the duration. You specify a duration to make sure that the Vusers continue performing the schedule action for a specific period so you can measure continuous load on the server.


In the Interactive Schedule Graph, click the horizontal line which represents Duration. The line is highlighted and a dot and a diamond are displayed at its endpoints. Note that if the Legend is displayed on top of the diamond, click the Hide Legend button on the Interactive Schedule Graph toolbar to show the diamond.


Drag the diamond shaped endpoint to the right until the time in brackets reads You have just set the Vusers to run for a period of 10 minutes. Schedule a gradual closure. Gradually stopping Vusers is recommended to help detect memory leaks and check system recovery, after the application has reached a threshold. Double-click Stop Vusers in the Global Schedule grid. The Edit Action dialog box opens displaying the Stop Vusers action.


Select the second option and enter the following values—2 Vusers every 30 seconds. How do I emulate different types of users? Now that you have configured a load schedule, you will specify how the Vusers will behave during the test. Behavior refers to the time that a user takes to pause between actions, the number of times a user repeats an action, and so on.


Open the run-time settings. In the Controller, click the Design tab. The Run-Time Settings dialog box opens. The run-time settings let you emulate different kinds of user activity and behavior. They include: Run Logic. The number of times a Vuser repeats a set of actions. The time to wait before repeating the action. The level of information that you want to gather during the test. The first time you run a scenario, it is recommended to generate log messages to make sure that you have debugging information in case the first run fails.


Think Time. The time the user stops to think between steps. Since users interact with the application according to their experience level and objectives, more technically proficient users may work more quickly than new users. Vusers can be made to emulate their real- world counterparts more accurately during a load test by enabling think time.


Speed Simulation. Users using different network connections such as modem, DSL, and cable. Browser Emulation. Content Check. For automatically detecting user-defined errors. This custom page always contains the words ASP Error.


You need to search all of the pages returned by the server and see if the text ASP Error appears. You can set up LoadRunner to automatically look for this text during the test run, using the Content Check run-time settings.


LoadRunner searches for the text and generates an error if it is detected. During the scenario run, you can identify the content check errors. Enable think time. Select Replay think time, and select Use random percentage of recorded think time.


The above specifications use a random percentage of the recorded think time to emulate users with a varying range of proficiency. Enable logging. Select Enable logging. Under Log options, select Always send messages. Click Extended log, and select Data returned by server. It is enabled only for the purposes of this tutorial to provide information for the Vuser Output log. Save the scenario. How do I monitor the system under load? Now that you have defined how your Vusers will behave during the test, you are ready to set up your monitors.


While generating a load on an application, you want to see how the application performs in real time and where potential bottlenecks exist. For instance, you can select a Web Server Resources monitor according to the type of Web server that is running.


You can purchase a license for the relevant monitor, for example IIS, and use that monitor to pinpoint problems reflected in the IIS resources. In this section, you will learn how to add and configure the Windows Resources monitor.


You can use this monitor to determine the impact of load on your CPU, disk, and memory resources. Select the Windows Resources Monitor.


Click the Run tab at the bottom of the Controller. The Windows Resources graph is one of four default graphs that are displayed in the graph viewing area. You will learn how to open other graphs in the next lesson. Right-click inside the Windows Resources graph and select Add Measurements. The Windows Resources dialog box opens. Select the monitored server.


The Add Machine dialog box opens. In the Name box, type localhost. If your load generator was running off a different machine you would type the server name or IP address of that machine. From the Platform list, select the platform on which the machine runs.


Activate the monitor. In this lesson you will cover the following topics: l The Controller Run view at a glance l How do I run a load test scenario? The Controller Run view at a glance The Run tab in the Controller is the control center from which the scenario is managed and monitored.


The Run tab located at the lower section of the Controller window contains five panes: 1. In the upper-left pane, you can view the status of Vusers in the scenario groups. You use the buttons to the right of this pane to start, stop, and reset the scenario, to view individual Vuser status, and to increase the load on the application during a scenario by manually adding more Vusers. Scenario Status pane.


In the upper-right pane, you can view a summary of the load test, including the number of running Vusers and the status of each Vuser action. Available Graphs pane. In the middle-left pane, you can see a list of the LoadRunner graphs. To open a graph, select a graph in the tree, and drag it into the graph viewing area. Graph Display pane. Graph Legend pane. In the bottom pane, you can view data from the selected graph. Note that the control for the Run tab is at the bottom of the Controller.


In this section, you will start the scenario. Open the Controller Run view. Notice that there are 8 Vusers in the Down column of the Scenario Groups pane. These are the Vusers you created when you created the scenario. Since the scenario has not yet run, all other counters remain at zero and all the graphs in the graph viewing area except Windows Resources are blank.


When you start running the scenario in the next step, the graphs and counters will begin to display information. Start the scenario. If you are running the tutorial for the first time, the Controller begins the scenario.


If you are repeating the test, you will be prompted to overwrite the existing results file. Click No, because the results of the first load test should be used as baseline results to be compared with subsequent load test results. The Set Results Directory dialog box opens.


Enter a unique and meaningful name for each results set, because you may want to superimpose the results of several scenario runs when you come to analyze the graphs. How do I monitor the application under load? You use this information to isolate potential problem areas in your system environment. Examine the performance graphs. The Graph Display pane of the Run tab displays the following default graphs: a.


Running Vusers - Whole Scenario graph. Displays the number of Vusers running at a given time. Transaction Response Time - Whole Scenario graph. Shows the amount of time it takes for each transaction to be completed. Hits per Second - Whole Scenario graph. Windows Resources graph. Highlight individual measurements.


Double-click the Windows Resources graph to enlarge it to fit the entire Graph Display pane. Notice that each measurement appears on a color-coded row in the Graph Legend pane. Each row corresponds to a line in the graph with the same color.


Select a row to highlight the corresponding line in the graph, and vice versa. Double-click the graph again to reduce its size. View the throughput information. The Throughput graph shows the amount of data measured in bytes that the Vusers receive from the server in any given second. You can compare this graph with the Transaction Response Time graph to see how throughput affects transaction performance.


If the throughput scales upward as time progresses and the number of Vusers increases, this indicates that the bandwidth is sufficient. If the graph were to remain relatively flat as the number of Vusers increased, it would be reasonable to conclude that the bandwidth is constraining the volume of data delivered.


When emulating users, you should be able to view the Vusers' actions in real time to make sure they are performing the correct actions. The Controller lets you view the actions in real time using the Run-Time Viewer. In the Controller's Run tab, click the Vusers button. The Vusers dialog box opens. The Status column displays the status of each Vuser. In the example above, you can see that four Vusers are running and four are down. The Start Vusers action in the scheduler instructed the Controller to release two Vusers at a time.


As the scenario progresses, Vusers will continue to be added in groups of two at second intervals. Select a running Vuser in the Vuser list. Click the Show the selected Vusers button on the Vusers toolbar. The Run-Time Viewer opens and displays the actions performed by the selected Vuser. Where can I view a summary of Vuser actions? In the Vusers window, select a running Vuser. Click the Show Vuser Log button on the Vusers toolbar. The Vuser log dialog box opens. The log contains messages that correspond to the actions of the Vuser.


For example, in the window above, the message Virtual User Script started indicates the start of the Vuser's run. Scroll to the bottom of the log and watch as new messages are added for each action performed by the Vuser. Close the Vuser Log dialog box and the Vusers dialog box. How can I increase the load during the test? You can manually add more Vusers during a load test to increase the load on the system.


To increase the load during a load test: a. Make sure that in the Controller, the Run tab is displayed b. In the column, enter the number of Vusers that you want to add to the group. To run two additional Vusers, replace the number 8 with the number 2, in the column. Click Run to add the Vusers. If some of the original Vusers have not yet been initialized, the Run Initialized and Run New options appear.


Select the Run New option. The Scenario Status pane shows that there are now 10 running Vusers. You may get a warning message that the LoadRunner Controller cannot activate additional Vusers. This is because you are using your local machine as a load generator and it has limited memory resources. Generally, use a dedicated machine as a load generator to avoid this issue. How is the application performing under load? Check the Scenario Status pane [on the Run tab] for a summary of the running scenario.


In the Scenario Status pane, you can drill down to see which Vuser actions are causing the application problems. A high number of failed transactions and errors may indicate that the application is not performing as required under load. View the scenario status. The header of the Scenario Status pane displays the overall status of the scenario. View a breakdown of Vuser actions. Click Passed Transactions in the Scenario Status pane. The Transactions dialog box opens and displays a list of transaction details.


Click Close to close the Transactions dialog box. Did the application encounter errors? If an application starts to fail under heavy load, you are likely to encounter errors and failed transactions. The Controller displays error messages in the Output window. Check for any error or warning messages. You can sort the message by type, such as Warnings or Errors. The Output dialog box opens and lists a message text, the total number of messages generated, the Vusers and load generators that generated the error, and the scripts in which the errors occurred.


To view a message in detail, select the message and click Details. The Detailed Message Text box opens, displaying the complete message text. View log information details. You can view information about each message, Vuser, script, and load generator associated with an error code by clicking the blue link in the appropriate column. For example, to locate where in the script an error occurred, drill down the Total Messages column. The Output window displays a list of all messages of the selected error code, including the time, iteration number, and line in the script where the error occurred.


Drill down the Line Number column. VuGen opens, displaying the line in the script at which the error occurred. You can use this information to identify transactions with slow response times that are causing the application to fail under load. How do I know that the scenario has finished running? At the conclusion of a scenario run, the header of the Scenario Status pane shows the Down status. This indicates that all the Vusers in the scenario have finished running.


The Vuser dialog box displays the number of iterations that each Vuser performed, the number of successful iterations, and the elapsed time. Did the system perform well under load? To see how well the system performed under load, look at the transaction response times and determine whether the response times were within acceptable limits. If the transaction response times increase during the scenario, you need to look for bottlenecks.



Comments

Popular posts from this blog

Sample 10 mb pdf file download

Ultra copy free download full version