Vinod Kumar
Visitor.
402 views

Trying to pass the captured correlated value in upcoming request correlated variable name is passed.

Jump to solution

Hi I have captured CSRF token value with web_reg_save_param. The value is getting captured which I can see in output log as below

Action.c(16): Notify: Saving Parameter "C_CSRF = 8eb3614e-4a02-41a9-9502-c7f25d032514".

On trying to Pass the Value in next request the value is getting passed with varaible name instead of value as below

Action.c(50): Notify: Saving Parameter "CSRF = {C_CSRF}".

I also tried saving value to another varaible and pass still didnt work. 
lr_save_string(lr_eval_string("{C_CSRF}"),"CSRF");

Note: The above issue is happening on HP LoadRunner 12.53 build 1203

0 Likes
1 Solution

Accepted Solutions
Outstanding Contributor.. JHF Remmelzwaal Outstanding Contributor..
Outstanding Contributor..

Re: Trying to pass the captured correlated value in upcoming request correlated variable name is pas

Jump to solution

Hi Vinod,

A log line related to parameter substitution should read something like

Action.c(32): Notify: Parameter Substitution: parameter "C2" =  "191"

but yours at line 50 corresponds to a web_reg_save_* function.

Two things are important in respect to LR parameters.

Not all functions (or parameters of a function) will expand parameters. Consult the function help to learn which does or don't.

The patterns for recognizing a LR-parameter in an LR function is by default {LR-PARAMETER}, but you can change that in your solution: Tools -> Options -> Scripting -> Paramters.

When you define a LR-parameter (Ctrl-K) and you use it in your script, the paramter name gets 'highlighted'. I've the habbit to register also the parameters that are generated by web_reg_param_* functions as custome type, so they get highlighted in my script. That helps in respect to typo's etc.

Please validate your parameter settings or submit a part of your code from web_reg_param_* till the incorrect usage (mask private info).

Signature:
Reward community members who take time to respond and help.
2 Replies
Outstanding Contributor.. JHF Remmelzwaal Outstanding Contributor..
Outstanding Contributor..

Re: Trying to pass the captured correlated value in upcoming request correlated variable name is pas

Jump to solution

Hi Vinod,

A log line related to parameter substitution should read something like

Action.c(32): Notify: Parameter Substitution: parameter "C2" =  "191"

but yours at line 50 corresponds to a web_reg_save_* function.

Two things are important in respect to LR parameters.

Not all functions (or parameters of a function) will expand parameters. Consult the function help to learn which does or don't.

The patterns for recognizing a LR-parameter in an LR function is by default {LR-PARAMETER}, but you can change that in your solution: Tools -> Options -> Scripting -> Paramters.

When you define a LR-parameter (Ctrl-K) and you use it in your script, the paramter name gets 'highlighted'. I've the habbit to register also the parameters that are generated by web_reg_param_* functions as custome type, so they get highlighted in my script. That helps in respect to typo's etc.

Please validate your parameter settings or submit a part of your code from web_reg_param_* till the incorrect usage (mask private info).

Signature:
Reward community members who take time to respond and help.
Vinod Kumar
Visitor.

Re: Trying to pass the captured correlated value in upcoming request correlated variable name is pas

Jump to solution
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.