Posts tagged ‘loadrunner tutorial’

Creating Custom Request in VuGen LoadRunner

There are some situations where you need to create custom request so that you can manipulate the request according to your need. Here we will see how to create custom request and tamper with it to get our job done.


When we record the script for any web application, we generally choose HTML-based recording because it is easy and minimizes the correlations you have to handle in the script.

LoadRunner do generate custom request when some request does not fall under category of lr_web_submit_data() or lr_web_submit_form() requests category.


Suppose there is one request where you are sending some data items with it and every time there will be random number of data items like, first time there will be four data items second time there will be five data items in the same request. Here you cannot use same recorded request as number of data items are going to be different every time.

In below example you can see that there are only four data items in the request next time there may be five data item.

“Name=SearchResultsGrid_ctl04_ViewPackageDialogResult”, “Value=291570”, ENDITEM,
“Name=SearchResultsGrid_ctl08_ViewPackageDialogResult”, “Value=291566”, ENDITEM,
“Name=SearchResultsGrid_ctl11_ViewPackageDialogResult”, “Value=291563”, ENDITEM,
“Name=SearchResultsGrid_ctl12_ViewPackageDialogResult”, “Value=291562”, ENDITEM,


Here you can create a custom request and use a parameter which will hold the manipulated string of data items. In that string you can save different number of data items and you can change it as required.


    1. First record the script with HTML-based recording and with proper transaction names for every action.
    2. Save that script and then click on Tools> Regenerate Script…

    1. Below popup will come, click on Options…

    1. It will show you the Regenerate options, Click on General> Recoding

  1. There are two options available, HTML-based script and URL-based script. Choose URL-based script.
  2. For URL-based script there is a button for advanced settings named URL Advanced, click on it.
  3. From the new popup select Use web_custom_request only.
  4. Save the settings and regenerate the script.
  5. In the regenerated script you can see that new script is generated which contain only web_custom_request.
  6. Now find the particular request which you want to manipulate with the help of transaction names which you have given while recording the script.

Below is the HTML-based recorded request, You can see that there are four data items of grid results,

“Name=SearchResultsGrid_ctl03_ViewPackageDialogResult”, “Value={c_PackageID}”, ENDITEM,
“Name=SearchResultsGrid_ctl04_ViewPackageDialogResult”, “Value=291570”, ENDITEM,
“Name=SearchResultsGrid_ctl08_ViewPackageDialogResult”, “Value=291566”, ENDITEM,
“Name=SearchResultsGrid_ctl11_ViewPackageDialogResult”, “Value=291563”, ENDITEM,
“Name=SearchResultsGrid_ctl12_ViewPackageDialogResult”, “Value=291562”, ENDITEM,

Below is the custom request which is URL-based,

“URL=http:// {p_Url}/site/secure/reportcenter/managepackages.aspx”,
“Referer= http://{p_Url}/site/secure/reportcenter/managepackages.aspx”,
/*//below string is going to vary every time so we are going to manipulate it every time using string manipulation functions//


In custom request you can manipulate final string every time using string manipulation functions available in VuGen.

final_string= &SearchResultsGrid_ctl04_ViewPackageDialogResult=291570




P.S. : Thanks to Kranti.