Automate Parameterization in LoadRunner

As we are in the Agile/DevOps world, re-generating the scripts after every build and bringing in all the customization from the previously working scripts to the newly created scripts is one of the major challenges faced by Performance Testers. In this article, we are going to see how we can automate or partially automate the process of bringing the parameterization into the newly created scripts.

Any parameterized Loadrunner script will have .prm and .dat files in the script folder. Just to be clear, the .prm file contains the column and details about the parameterization and the .dat file contains the actual parameter values or test data.

Scenario:

Assume that we created a script WebHttp3 a few days ago and it has all the required parameters and today a new code was deployed and we are in a situation to regenerate the script. So, we recorded a new script WebHttp4. Once we have done this, we will have to ensure that the parameterization is done similarly to the previously working script.

The simple way to bring in the parameterization is to copy the .prm and .dat files from the working script folder to the newly created script folder and rename the .prm file to the newly created script folder name. i.e. WebHttp4.prm. This can be done manually quickly. However, when we have to do this for multiple scrips in a short span of time, or to the same script we have to do this frequently then automating this entire process makes sense.

Solution:

Considering the nature of this repeatable task, I have developed a simple Java-based utility that would do the above process automatically.

Step by Step Instruction:

  1. Download the automateparams.jar file from the following GitHub URL GitHub URL
  2. Download the jar file to any local folder.
  3. Open the command prompt and navigate to that folder.
  4. Execute the following command:
    autoparams.jar <source script folder path> <destination or newly created script folder path>
    Example: autoparams.jar C:\LR\LRUtils\WebHttpHtml3 C:\LR\LRUtils\WebHttpHtml4
  5. Verify that all the .prm files and .dat files are copied to the new script folder.
  6. Don’t forget to do the following in your LoadRunner script: Just replace the hard-coded values in the script with respective parameters.
    Example: 12345 -> {User_Id}

You may be interested:


Leave a Comment