Sunday, January 26, 2014

Lr_save_string In Loadrunner With Examples



we use lr_save_string mainly to convert a string to parameter and use that parameter wherever required.

Example 1:

In this example I have saved my website name in a string a[] and I converted the string to parameter using lr save string and I used URL in web_url function as shown below.



char a[]="http://loadrunnerz.blogspot.com/";
     
    
lr_save_string(a,"URL");
 
    
web_url("Home Page",
    
"URL={URL}",
    
"TargetFrame=",
    
"Resource=0",
    
"RecContentType=text/html",
    
"Mode=HTML",
    
LAST );

Example 2:

In this example I have saved a string directly into lr save string as shown below and I used URL parameter in web_url. Please note that if you are using string directly you need to give double quotations. If you are declaring as string, as shown in the above example then there is no need to use double quotations.

lr_save_string("http://loadrunnerz.blogspot.com/","URL");
 
    
web_url("Home Page",
    
"URL={URL}",
    
"TargetFrame=",
    
"Resource=0",
    
"RecContentType=text/html",
    
"Mode=HTML",
    
LAST );

No comments:

Post a Comment