Answered question

How to build a grouped Variable Extractor?

From the Documentation:
If you choose to process all the matched occurrences, the following variables are automatically created:

<VariableName>_matchNr - the number of occurrences found; can be 0.
<VariableName>_n, where n = 1,2,3 and so on. - the strings as generated by the value template.
<VariableName>_n_gm, where m=0,1,2 - the groups matching n
<VariableName> - always attached to the default value
<VariableName>_rand, random string from generated strings
<VariableName>_rand_gm, where m=0,1,2 - the groups matching rand

I have a list like this:
[
"beige",
"beige"
],
[
"blue",
"blau"
],
[
"brown",
"braun"
],

And I think a group would be the best, because the values are pairs, which are needed together. But how do I tell Neoload to build groups while extracting all occurrences. Is there a special key I can provide to the pattern?
The regular expression right now is:
\n "([,]*?)(.*?)([,]*?)(.*?)"
The pattern is: $2$$4$
But I get only one list with all of them sequentially.
Like Param_1 = ""
Param_2=""
Param_3="beige"
Param_4="beige"
Param_5="blue"
Param_6="blau"
I'd want to have
Param_3_g1="blue"
Param_3_g2="blau"
(Not sure if I put the right way, as I not tried, but I hope it becomes clear, where I want to go)

Any hints welcome. I'm sure I did that already, but I don't find it. (nice feature btw.)

bye

frank

Frank K.
Frank K.

Frank K.

Level
0
25 / 100
points
Benoit D.
Benoit D.

Benoit D.

Level
1
223 / 750
points
Team

When you use the group feature, the template is not used.
In your case, you can use "Param_3_g2" to get the content of the second group of your regular expression (whatever the template).

I try your example and it works fine using the regular expression:
"(.*?)"[,]([^^]*?)"(.*?)"
and the groups 1 and 3 (Param_n_g1 and Param_n_g3).

Best regards.

Did you find this useful ?

No (0)

Yes (1)

100%

100% of users found this answer useful

Other answers

Frank K.
Frank K.

Frank K.

Level
0
25 / 100
points

How do I activate the group feature? This is what I don't find.
It should work with my regex as well with g2 and g4 if I understand right, and my regex focuses better on the data. Your regex just gets to much of the rest of the page.

bye

frank

Frank K.
Frank K.

Frank K.

Level
0
25 / 100
points

Okay. I now found the problem. Only the $4$ put data with the old regex.
I changed to "(\")([^"]+)(\"),\n (\")([^"]+)(\")" as regex and now I have the desired values on _g2 and _g5.

Thanks a lot for the hint.