Loadrunner Tutorial-1 (Record and Playback)

To begin recording user actions, open VuGen and create a blank script. You fill the blank script by recording events and adding manual enhancements.
In this section, you will open VuGen and create a blank Web script.
 1. Start LoadRunner.
Choose Start > Programs > Mercury LoadRunner > LoadRunner. The Mercury LoadRunner Launcher window opens.


2. In the Launcher window, click the Load Testing tab.
Click Create/Edit Scripts. VuGen’s Start Page opens
3. Create a blank Web script.
Click New Vuser Script in the Scripts tab in the VuGen Start Page.
The New Virtual User dialog box opens, displaying the options for a new single protocol script.


A protocol is the language that your client uses to communicate with the back-end of the system. Mercury Tours is a Web-based application, so you will create a Web virtual user script. 
Make sure the Category type is All Protocols. VuGen displays a list of all of the available protocols for a single protocol script. Scroll down the list, select Web (HTTP/HTML), and click OK to create an empty Web script. 
The next step in creating user emulation, is recording the events performed by a real user. In the previous section, you created an empty Web script. Now you can begin to record events directly into the script. In this section, you will track the events of one passenger reserving a flight from Denver to Los Angeles and then checking the flight itinerary.
To record the script:
1. Start recording on the Mercury Tours Web site.
Click Record Application in step 1 in the Task pane.
Click Start Recording at the bottom of the instruction pane.


Alternatively you can choose Vuser > Start Record or click the Start Record button in the Toolbar at the top of the page.
The Start Recording dialog box opens.
In the URL address box, type http://localhost:1080/MercuryWebTours/
In the Record into Action box, choose Action. Click OK.
A new Web browser opens and displays the Mercury Tours site. 

The floating Recording toolbar opens.


2 Log on to the Mercury Tours Web site. 
For the Member Name enter jojo and for the Password enter bean. Click Login. A welcome page opens.
3 Enter flight details.
Click Flights. The Find Flight page opens: 
  • Departure City: Denver (default)
  • Departure Date: Keep the default, current date
  • Arrival City: Los Angeles
  • Return Date: Keep the default, tomorrow’s date.
  • Seating Preference: Aisle
Keep the rest of the default settings and click Continue. The Search Results page opens.
4 Select a flight.
Click Continue to accept the default flight selections. The Payment Details page opens.
5 Enter payment information and book flight.
Enter 12345678 in the Credit Card box and type 06/06 in the Exp Date box. Click Continue. The Invoice page opens, displaying your invoice.
6 Check the itinerary.
Click Itinerary in the left pane. The Itinerary page opens.
7 Click Sign Off in the left pane.
8 Click Stop on the floating toolbar to stop the recording process.
The Code Generation pop up window opens while the Vuser script is being generated. The VuGen wizard then automatically proceeds to the next step in the task pane and displays the recording summary. (If you do not see the summary, click Recording Summary in the Task pane.)


The recording summary includes the protocol information and a list of the actions created during the session. For each step you performed during recording VuGen generated a snapshot, a picture of the window during recording. Thumbnails of these recorded snapshots are displayed in the right pane. If, for whatever reason, you want to rerecord your script, you can click the Record Again button at the bottom of the page.
9 Choose File > Save or click the Save button. Type basic_tutorial in the File name box and click Save. VuGen saves the file in the LoadRunner script folder and displays the test name in the title bar.