Highlighted
Absent Member.
Absent Member.
1545 views

customizing loadrunner script

Jump to solution
Hi, I've written the following the code in LR script. All I want to do is to add the value in nHeader variable to the body of the web_custom_request. Please check and let me know what's wrong.
-----------------------------------------------
int i; int nHeader;
nHeader = 2;
for (i=1;i<=4;i++) {
lr_output_message("ITERATION NO: %d", i);
nSnapshot = 12;

lr_start_transaction("Add02");

lr_end_transaction("Add02",LR_AUTO);

lr_start_transaction("Save02");

lr_think_time(437);
web_custom_request("showCreateRequestTEST.do_9",
"URL=http://192.168.1.3:8088/slp-web/private/showCreateRequestTEST.do",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.1.3:8088/slp-web/private/showCreateRequestTEST.do",
"Snapshot=t12.inf",
"Mode=HTML",
"EncType=application/x-www-form-urlencoded; charset=UTF-8",
"Body=hdnTab=FI&hdnMode=ADD&hdnData="
"E%20%5E%20%5E&hdnSearch=&isCopyRequest=false&hdnRecNo=1&hdnHeaderID={FareRequestID}&hdnHeaderVersion={nHeader}",
LAST);

lr_end_transaction("Save02",LR_AUTO);

nHeader+=2;
----------------------------------------------
I get a message saying, The string 'nHeader' with parameter delimiters is not a parameter.
0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: customizing loadrunner script

Jump to solution
You might want to name your variables and your LR parameters differently - you might be mixing usage and not realizing it. I use a prefix, like "p_".

If you are attempting to write the int nHeader directly to the LR paramter of the same name, you need to lr_save_int(nHeader, "nHeader");

View solution in original post

2 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: customizing loadrunner script

Jump to solution
You might want to name your variables and your LR parameters differently - you might be mixing usage and not realizing it. I use a prefix, like "p_".

If you are attempting to write the int nHeader directly to the LR paramter of the same name, you need to lr_save_int(nHeader, "nHeader");

View solution in original post

Highlighted
Absent Member.
Absent Member.

Re: customizing loadrunner script

Jump to solution
Thanks for your reply. It worked!
Appreciate your help.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.