I have a problem in JMeter that I can't figure out how to solve.
Situation:
Now I used following RegEx to extract the ScriptResource values: <script src="(.+/ScriptResource.+?)". Then I stored the 3 matched values into 3 different variables. But I can't replace the values in the found order. Example: First Match: stored in : AspNet_ScriptResource Second match stored in: AspNet_ScriptResource_1 Third match stored in: AspNet_ScriptResource_2
The three matches have all different values, can't paste one value into all 3 matches. So I have to write the value from AspNet_ScriptResource into the first match (matchNr=1). AspNet_ScriptResource_1 into second match (matchNr = 2) and AspNet_ScriptResource_2 into third match (matchNr = 3).
But in the Correlation Rules (in the Correlation Recorder) in the "Correlation Replacement" section, there is no option to choose in which matchNr to write.
Correlation Recorder: Correlation Rules
I tried to use a BeanShell Preprocessor with a for-loop but I only found a way to write in the logs, not in the response body.
Is there a way to solve this with the Correlation Recorder plugin? If not, what options do I have to handle such a scenario?
Thanks for your help! :)
You can raise an enhancement request for the bzm - Correlation Recorder via JMeter Plugins support forum or if you're a BlazeMeter customer and need this piece of functionality asap - you can open a support ticket for implementation of the feature.
Currently it seems that the Correlation Recorder expects you to provide a regular expression either with the unique match or you will have multiple substitutions with the same value.
With regards to Beanshell approach:
prev.setResponseData()
functionsampler.getArguments()
function