Highlighted
Established Member..
Established Member..
1326 views

Determining LB and RB in correlation parameter

Jump to solution

Hi, 

I am trying to capture the session value (bold and italicised) below and I am struggling to do it. Can someone help me determine the LB and RB in the expression, please? 

Here is the code, 

<div>
<input type="hidden" name="lt" value="LT-3421-nxfUSxJtd9456LE4zOcytzqbgtav7v" />

This is what I am doing, 

web_reg_save_param_ex("ParamName=LTValue",
"LB=\name\=\"lt\"\\value\=",
"RB=/>",
SEARCH_FILTERS,
"Scope=All",
LAST);

0 Likes
1 Solution

Accepted Solutions
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Determining LB and RB in correlation parameter

Jump to solution

Hi

First of all, if you are new to LoadRunner, make sure that it is placed on the correct place. It should be placed before the call that is returning this value.

When it comes to the matching, it is only backspace (\) and double-quote (") that should be escaped.  So the call below should be working.

web_reg_save_param_ex("ParamName=LTValue",
   "LB=name=\"lt\" value=\"",
   "RB=\"",
   SEARCH_FILTERS,
  "Scope=All",
LAST);



br /ola


Please mark post as solved if your problems or questions is/are resolved.
If this post was valuable to you, please consider kudo it.

 

.

View solution in original post

4 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Determining LB and RB in correlation parameter

Jump to solution

Hi

First of all, if you are new to LoadRunner, make sure that it is placed on the correct place. It should be placed before the call that is returning this value.

When it comes to the matching, it is only backspace (\) and double-quote (") that should be escaped.  So the call below should be working.

web_reg_save_param_ex("ParamName=LTValue",
   "LB=name=\"lt\" value=\"",
   "RB=\"",
   SEARCH_FILTERS,
  "Scope=All",
LAST);



br /ola


Please mark post as solved if your problems or questions is/are resolved.
If this post was valuable to you, please consider kudo it.

 

.

View solution in original post

Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Determining LB and RB in correlation parameter

Jump to solution

Or if you are more familiar with regex syntax, you could use

lr_web_reg_save_param_regexp()

br /ola


Please mark post as solved if your problems or questions is/are resolved.
If this post was valuable to you, please consider kudo it.

.
0 Likes
Highlighted
Established Member..
Established Member..

Re: Determining LB and RB in correlation parameter

Jump to solution

Thanks a lot for the solution. I am placing it before the call that's returning the value in the script. Although, I think I lack the knoledge of escape characters like (\) and how to use them in capturing values. 

I am familiar with reg expression function, but I would appreciate if you could use the same code and give me an example using the regexp() function. 

0 Likes
Highlighted
Established Member..
Established Member..

Re: Determining LB and RB in correlation parameter

Jump to solution

Also, 

I am trying to capture values for this 

var userId = '65236';


and I am doing this....not sure where I am going wrong 

web_reg_save_param_ex("ParamName=VarUserID",
"LB=var userId = \''",
"RB=\;",
SEARCH_FILTERS,
"Scope=All",
LAST);

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.