HP LoadRunner is load simulation software that can capture the traffic between a client and application, such as PeopleSoft. The load testing process using HP LoadRunner includes:
· Creating/Editing a script (Virtual User Generator)
o Recording of scripts
o Enhancement of scripts such as replacing hard coded values (such as user ID) with parameters
o Correlation of values generated by the server dynamically (such as sessionID and page tracking numbers)
Creating the script
The following instructions and screen shots will guide you through the process of creating a script, running the test, and analyzing the results.
1.) Launch Loadrunner. Find the Loadrunner icon, and double click.
At the following window, choose Create/Edit Scripts
2.) In the Virtual User Generator screen, click on the following icon to begin creating a new script:
3.) Choose “Web (HTTP/HTML)” and then click “Create”
4.) The next window will give you an overview of how to generate scripts. Feel free to read through these steps if you wish and then click “Next”
5.) The following window provides an introduction to recording scripts. Again, you may read the information if you would like, and then click on “Start Recording”, when you are ready.
6.) At the next prompt, you will need to enter in the URL address for the PeopleSoft environment. For our demo this will be http://10.1.9.126/ps/signon.html. If this address is not currently in the “URL Address” box, please enter it in now. Then click on “Options”
7.) In the recording options window, you are going to verify or update Headers and Correlations. Under “HTTP Properties”, first click on “Advanced”. Then under “Recording schemes”, click on the button marked “Headers”. Make sure “Accept – Encoding” and “Accept – Language” are selected. Then click on “OK”.
8.) Next, under the “HTTP Properties” menu, choose “Correlation”. Here, you can check the “PeopleSoft” box, and uncheck any other applications listed.
9.) Next, expand the PeopleSoft correlations by clicking on the “+” box. Make sure you have a correlation called “ICSID”. If you do not, click on the “New Rule” button and create a rule called “ICSID”. The Action should be “Search for parameters in all the body of the text”. The Left boundary should read [ name=’ICSID’ value=’ ], and the Right boundary should be [ ‘ ]. Check the Parameter Prefix box and enter in “PeopleSoft_ICSID” as shown below.
This correlation has the purpose of recording your login name and password to the PeopleSoft application. Otherwise, the script will lose authentication while running and you will end up with error windows during playback.
Once you are done, click on “OK”.
10.) You will return to the “Start Recording” window and you can click “OK”.
11.) Next, LoadRunner will start recording and will launch another Internet window with the PeopleSoft URL. In load testing, you would want to take a sample of the business processes you expect your user population to use. For the sake of this demo, we will record a simple script where an employee logs into the system, views her paycheck, views her current home and mailing address, and then views her benefits summary page and logs off.
On the first page, you will enter in your User ID and Password.
User ID: demoxx (where xx = the number of your workstation – Example: demo01 for workstation 01)Password: demoxx
12.) Once you have logged into PeopleSoft, choose “Main Menu” and then click on “Self Service”.
13.) At the Self-Service screen, choose “View Paycheck”
14.) Here, you can choose one of the paychecks to view. And then you can scroll through and view the information.
15.) Once you have completed this, you will review home and mailing address. To do this, click on “Self-Service” from the menu bar, hover your mouse above “Personal Information”, and then click on “Home and Mailing Address”.
16.) Here you will be able to review the address information. An employee might want to change his or her address information after moving. For the sake of this demo, we will simply view the address information.
17.) Next, click on “Self-Service” from the menu above again, and hover over “Benefits”, then click on “Benefits Summary”.
18.) During Open Enrollment, employees could go in and update their benefits information. For the demo script, you will simply view this information. Once you have done so, click on “Sign out”, and you will return to the login page.
19.) Now that you have created your script, toggle back to the Virtual User Generator application. Here you will click on the stop icon in order to finish recording. Then you will see the Code Generation window.
20.) Once the code generation is complete, you will modify the script and enhance it. First, go into Script View, by clicking on “View” from the menu bar, and then choosing “Script View”.
21.) Once in the script view, you are going to comment out transactions in the script that add cookies. The easiest way to do this is with a global Find and Replace. Click on “Edit” from the menu bar, and then choose “Replace”. In the subsequent Search and Replace box, type in “web_add_cookie” in the “Find What” box, and the in the “Replace With” box, type in
“# web_add_cookie” and then click on “Replace All”. Once this has completed, click on “Cancel”.
22.) At this point, you can set the Run-Time Settings and enhancements. To do this, click on “Vuser” from the menu bar, and then choose “Run-Time Settings”.
23.) Here, you will define some actions to be taken during the test playback. The first area is the “Run Logic”, which will define the number of iterations that you would like to playback for each simulated user. For this demo, we will leave the number of iterations at 1.
24.) The next item is “Pacing”. If you were running multiple iterations, you would want to pace how often your next virtual user is started. Since you would want pacing to reflect a real user load, you would not want to set "Start new Iteration" to "As soon as the previous iteration ends". It would be more typical that the next iteration would begin at some random interval. For this reason, we choose the radio button for “At” and choose “random” from the drop-down box for the interval. Then for the number of seconds to use, we would distribute these based on plus or minus 1/3 of the time it takes to run one iteration. So, for this test, we estimate that one iteration would take 2 minutes or 120 seconds. Multiplying this by 66% for the lower number and 133% for the higher number, we input 80 seconds and 160 seconds for the lower and upper limits for the random interval.
25.) Next is “Log”. Uncheck the “Enable logging” check box.
26.) “Think time” refers to the time it typically takes for a user to look at a page and decide where to go next. It will be different for different types of users. For example, an order entry clerk who repeats the same transactions several times a day would likely have less think time than a manager looking up information on his or her employees. For our self-service example, you should “Replay think time”, but check the box to “Limit think time to” and input 5 seconds. Or a random percentage is also fine.
27.) Skip down to “Miscellaneous” and where it says “Error Handling”, check the box for “Continue on error”
28.) Next, skip down to “Browser Emulation”. For the demo, check “Simulate a new user each iteration”, and uncheck “Clear cache on each iteration”. Leave the other two options checked. Check “Simulate a new user each iteration” when you record user login, logout, and transaction all in the Action section of the script AND you want to simulate new users between iterations. This will reset the context (such as cookies) during the script playback between iterations. When developing a larger load test, you would normally uncheck this box, as you would have several simulated users defined as part of your script.
30.) Now, click on the button called “New Rule”. In the “Search for Text” box, type “Page has expired”. “Match case” should be checked, and from the drop down box in the “Fail if” section, you should see “Found”. Once you are done, click on “OK”.
31.) Return to the Virtual User Generator Workflow page by clicking on the “Return to Workflow” button. The next step is to show the browser while the script is playing. Click on “Tools” from the menu bar and choose “General Options”. In the next window, choose the “Display” tab and check the box for “Show browser during replay” and then click on “OK”.
32.) Once back in the Workflow page, you will want to test running your script. Choose “Verify Replay” on the left-hand menu and then click on the button entitled “Start Replay”.
33.) Now you will see the script being run. It may take a few minutes for the test to initialize. Please wait. Once the test is complete, a window will pop up “Scanning for correlations”.
34.) After the correlation scan completes, you will return to the Workflow page. You should see “No errors detected” at the top of the screen, and you can scroll through the Recording and Replay views on the right-hand side to ensure everything looks the same. Once you are comfortable that your test script ran correctly, you can click “Next”.
35.) Now you will come to the Enhancements page. You may like to read through some of the steps on this page for future reference. You could manually input additional transactions into your script here. Parameterization would be used if you were developing a complex script with many simulated users and a robust data composition. Generally, we would recommend designing as capacity test with Parameterization. The last item, Content Checks, you have already included in a previous step. For your demo, you will not be adding any other enhancements
36.) At this point, it is recommended that you save your script. Choose “File” from the menu bar, and “Save As” and then choose a name. You could call it “demo_xyz” where xyz = your last name or something else that will identify your script so it is easily distinguishable.