Highlighted
Honored Contributor.
Honored Contributor.
4069 views

Correlation for multiple values with single regular expression

Hi,

I would like to know whether load runner is having the below functionality to extract the n number of value usinf single correlation function.

1)Extracting multiple values from the single response body with single correlation function similar to jmeter with Array format( Example: test_g1, test_g2)

This functionality is available for siebel protocol in loadrunner as per the user guide( mentioned as star array format)

Is it available in Http/Html protocol to extract multiple values with single regular expression?

Regards,

Raghul M

0 Likes
3 Replies
Highlighted
Honored Contributor.
Honored Contributor.

Re: Correlation for multiple values with single regular expression

If you don't specify ordinal, than the web_reg_save style function will save all the values that applies to this correlation and add a suffix of a number to differentiate between the different values saved.

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: Correlation for multiple values with single regular expression

hi, did you looked at the web_reg_save_param_regep spec:

http://lrhelp.saas.hpe.com/en/latest/help/function_reference/FuncRef.htm#web/lrFr_web_reg_save_param_regexp.htm?Highlight=web_reg_save_param_regexp

this API support regular expression gropus for capturing a selected group or all the groups in the regular expression (using the "Group=0" argument"

look in the "capture Groups" section.

TD;LR:

Capture Groups

The expression may have 0 to 10 capture groups. A capture group is bracketed in parentheses (). For example:
RegExp="^First Name ([^ ].+) .+Family Name"
This expresssion saves the first word after "First Name " on a line that contains "Family Name".

Pass "Group=0" to save the entire expression. If the expression has no capture group, you must pass "Group=0".

To capture the first capture group, you can either pass "Group=1" or not pass a Group argument.

To save the text specified by a capture group other than the first, pass the number. For example, if the body returned from the next web action function will contain
\\ link\\ will\\ lead\\ you\\ to\\ the\\ first\\ part\\ of\\ the\\ Correlation\\ ASP\\ v3\\.0!\\r,,
the following invocation saves "you".

    web_reg_save_param_regexp("ParamName=CorrelationParameter_2",
        "RegExp=\\ link\\ will\\ (.*?)\\ (.*?)\\ (.*?)\\ (.*?)\\ (.*?)\\ (.*?)\\ (.*?)\\ (.*?)\\ Correlation\\ ASP\\ v3\\.0!\\r",
        SEARCH_FILTERS,
        "Scope=Body",
        "IgnoreRedirections=No",
        "RequestUrl=*/Correlation_ASP_welcome.asp*",
        "Group=2",
        LAST);

If capture groups are nested, the capture groups are numbered by the opening bracket of the group. For example, this RE captures a first name, a middle name or initial, and a family name:
RegExp="^Full Name (([^ ].+) ([^ .].+).? ([^ ].+))"
The first name is opened second, so it is captured by "Group=2", the middle name or initial is captured by "Group=3", the family name is captured by "Group=4", and the entire name is captured by "Group=1". "Group=0" captures the entire phrase, including "Full Name".

 

 

Micro Focus Performance Core.
Functional Architect
your performance, our passion!
0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: Correlation for multiple values with single regular expression

Hi Moshka,

 

Thanks for the reply.

 

I have seen the option for regexp earlier which  is extracting the values by Group number. I f i need to capure all the group for the regular expression mention with a variable name, what is the step which i need to follow.

RegExp=\\ link\\ will\\ (.*?)\\ (.*?)\\ (.*?)\\ (.*?)\\ (.*?)\\ (.*?)\\ (.*?)\\ (.*?)\\ Correlation\\ ASP\\ v3\\.0!\\r

 In the above expression, I need to capture all the .*? values with a variable name. I have done this with jmeter and also i was using this function for the other tool. So I would like to implement the same using  the regular expression method in LoadRunner.

 

Regards,

Raghul M

Tags (1)
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.