Tuesday, November 12, 2013

Loadrunner Script Anatomy


When you record and save a LoadRunner script in VuGen, there are a number of files that are created. This post explains what they are and what they do.

For example, You have script named "01_TicketReservation" with one action,  then the required files you would need in the 01_TicketReservation script directory would be:

Files Created While Recording




Here's what is in each file:
01_TicketReservation.usr : Primarily, the .usr file defines which actions are used by the script. There are other properties which define which protocols are used and other settings.

default.usp: Contains the run logic for the script.

default.cfg: Contains the run-time settings (except for run-logic).

globals.h: The global headers file- visible and editable in Vugen.

*.c (Action files): These are the action files containing your script code. You can edit these files in any text editor, if you want. 

01_TicketReservation.prm: Contains the parameter definitions.

*.dat: Your data files, you can save these in the script directory or somewhere else, even a mapped network drive on a different server.

Files Created After Playback



result1: One or more result directories are created which contain script playback results.

*.idx: The .idx files are binary "index" files created by Vugen for holding parameter values.

01_TicketReservation.ci: It is a final Compiled Image of the LR script.

combined_01_TicketReservation.c:  A list of #includes for all of your Actions.

logfile.log, mdrv.log: random log files which you will probably never need to look at.

mdrv_cmd.txt, options.txt: These text files contain commands and arguments for the script compiler and driver (mdrv) and are created dynamically.

output.txt: This one is important. This file contains all of the log messages generated during script playback. The contents of this file appear in the "Output Window" section of Vugen.

output.bak: A backup of the above file.

pre_cci.c: Output from the C pre-processor, which contains all of the functions used in your script, from all of the Actions and header files.

Files Required for Playback
During the course of recording and playback of scripts, the VuGen application will create many files, but only some of them are necessary for playback (either in VuGen or the Controller).

In summary, you can delete: *.txt, *.log, *.idx, *.bak, result*, pre_cci.c, combined_*, *.ci

There is a quick shortcut you can use, rather than going through and deleting everything manually. In VuGen, Go to 'File' menu, select 'Zip Operations' and 'Export to zip file'. In the dialog, select the 'Runtime files' radio button and 'Ok'. Now you have a "clean" script without the extraneous files created by Vugen.




Advantages

  • Making LR script folder a bit smaller in size which could be beneficial, if the script needs to be archived and stored for extended periods of time.
  • Maintaining big script repository and taking regular backup of the entire script repository could be very disk-space consumption particularly if all run time data files and execution results are also unnecessarily being backed up.

2 comments:

Linux Series - SED Utility/Package - 4. Deleting Lines

Let’s explore sed’s explicit delete command, which you specify by using the option 'd'. Again, we are using the sample file named &#...