Search the site

LoadRunner Vugen: Make any SERVER or URL a Parameter

From Michael Hendershot:

// DEFINE VARIABLES
char *appurl; // Variable To Hold URL Name

// *******************************************************************************************
// START - SELECT ENVIRONMENT TO RUN LOADTEST AGAINST BY UNCOMMENTING THE CORRECT ENVIRONMENT
// *******************************************************************************************

//appurl = "server_url:9999"; // Application #1
appurl = "server_url:1111"; // Application #2

// CONVERT URL TO PARAMETER TO USE IN URLS BELOW
lr_save_string(appurl,"p_Url");

// *******************************************************************************************
// END - SELECT ENVIRONMENT TO RUN LOADTEST AGAINST BY UNCOMMENTING
//THE CORRECT ENVIRONMENT 
*******************************************************************************************

Once you add this code search and replace the section of the URL. Here is what it will look like:

web_url("login.jsp",
"URL=http://{p_Url}/xx/xxxx/xx/login.jsp",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=/xx/xx/xx/corner_cellbg.gif", ENDITEM,
LAST);

Subscribe to Our Podcasts
Our Clients Include…
  • Deloitte Services
  • Coventry Healthcare
  • CSX
  • Fifth Third Bank
  • HealthStream
  • Kroger
  • Max Technical Training
  • MPS Group
  • Sarasota Memorial Hospital
  • Take Charge America
  • Streamline Health Inc.
Our Contributors
Click Name for Full Profile