Playing Back Your Script

By recording a set of typical user actions such as booking flight, you created real user emulation. You replay your recorded script to verify that it runs properly before you incorporate it into a load testing scenario. During replay, you can view the actions in a browser and see if everything is as you expect it be. If the script doesn’t replay properly, you may need to add correlations.

Before replaying the script, you can configure run-time settings, which help you set the behaviour of the Vuser.

  • How do I set the run-time behaviour?
  • How do I watch my script running in real time?
  • Where can I view information about the replay?
  • How do I know if my test passed?
  • How do I search in or filter the results?

How do I set the run-time behaviour?

LoadRunner Run-Time settings let you emulate different kinds of real user activity and behaviour. For example, you could emulate a user who responds immediately to output from the server, or a user who stops and thinks before each response. You can also configure run-time settings to specify how many times the Vuser should repeat a set of actions and how often.

There are general run-time settings, and settings that are specific to certain Vuser types. For example, for Web emulation, you could instruct your Vusers to replay your script in Netscape instead of Internet Explorer

  • Run Logic: the number of repetitions
  • Pacing: the time to wait between repetitions
  • Think Time: the time the user stops to think between steps
  • Log: the level of information that you want to gather during playback

Note that you can also modify the run-time settings from the LoadRunner Controller or in Performance Center.

1 Open the run-time settings.

You can press F4 or click the Run-Time Settings button in the toolbar. The Run-Time settings dialog box opens.

2 Open the Run Logic settings.

Select the Run Logic node.

In this node you set the number of iterations, or the number of times to repeat the activity in succession. Set the number of iterations to 2.

3 Set the Pacing settings.

Select the Pacing node.

This node lets you control the time between iterations. You will specify a random time. This accurately emulates a real-life setting where the user waits between actions, but at random intervals—you don’t see real users waiting exactly 60 seconds between repetitions.

Choose the third option and select the following:

At random intervals every 60.00 to 90.00 seconds.

4 Set the Log settings.

Select the Log node.

The Log settings indicate how much information to log while running the test. During development, you may choose to enable some logging for debugging purposes, but once you verify that your script is functional, you can enable logging for errors only or disable it.

Select Extended log and enable Parameter substitution.

5 View the Think Time settings.

Select the Think Time node.

Do not make any changes. You will set the think-time from the Controller. Keep in mind that when you run the script in VuGen, it will run quickly since it will not include think-time.

6 Click OK to close the Run-Time Settings dialog box.

How do I watch my script running in real time?

VuGen’s run-time viewer feature displays the Vuser activities in real time as you playback the recorded script.

By default, VuGen runs your test in the background, without displaying an animation of the actions in your script. For this tutorial, however, you will instruct VuGen to display the actions in a viewer that lets you see how VuGen executes each step. The viewer is not an actual browser—it only displays snapshots of the pages that are returned to the Vuser.

1 Choose Tools > General Options and select the Display tab.

2 Select the Show browser during replay and Auto arrange window options.

3 Click OK to close the General Options.

4 Press F5 or click the Run button in the tool bar.

5 After a few moments, VuGen opens a run-time viewer and begins running the script in either script view or tree view, depending on what you last had open. In the run-time viewer, you visually observe the Vuser’s actions. Note how the replay is an exact playback of the steps you performed during recording.

Where can I view information about the replay?

When the script stops running, you can view a summary of the replay in the wizard. Click Verify Replay in the Task Pane to view the Last Replay Summary.

The Last Replay Summary lists any errors that may have been detected and displays thumbnails of the Recording and Replay snapshots. You can compare snapshots and look for discrepancies between your recording and the replay.

You can also look at the Vuser’s activity by reviewing a textual summary of the events. VuGen’s Replay Log tab in the Output window shows this colour coded information.

To view the replay log:

1 Click the replay log hyperlink in the instruction pane. Alternatively click the Show/Hide output button in the toolbar or choose View > Output Window from the menu. Then click the Replay Log tab.

2 Press Ctrl+F in the replay log to open the Find dialog box. Locate the following items:

  • Started, Terminated: the beginning and end of the script run—Virtual User Script Started, Vuser Terminated.
  • Iteration: the beginning and end of the iteration and the iteration number (orange lettering).

VuGen displays successful steps in green and errors in red. For example, if your connection broke in the middle of the test, VuGen indicates the line number of the error and displays the whole line in red text.

3 Double-click on a line in the replay log. VuGen takes you to the corresponding step in the script. A vertical black line on the left side of the script view indicates this step.

How do I know if my test passed?

After you playback the events that you recorded, you need to look at the results and see if everything succeeded. If something failed, you want to know why and when it failed.

In this section you will view and analyze the results of your script run. VuGen summarizes the results of the replay in the Test Results window.

To view test results:

1 Choose View > Test Results. A new results window opens.

When the Test Results window first opens, it contains two panes: Tree pane (on the left) and Summary pane (on the right).

The Tree pane contains the results tree. Each iteration is numbered. The Summary pane contains the details of the test.

<< Create New Script                                Parameterization >>

3 Comments

  1. Rupesh Shetty says:

    Really good site for newbies

  2. Aparna says:

    Thanks for the valuable info . It helped a lot

  3. Shipra says:

    Hi,

    I have recorded a scenario “launch Google page and close”.After replaying the script getting below error:

    Error -27279: Internal Error – Report initialization failed

    Can you please suggest on this please?

    Thanks

Leave a Reply