Regex Extractor uses old values when extending variable in template
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.3k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 5
Description
**Jason Kershaw** ([Bug 65322](https://bz.apache.org/bugzilla//show_bug.cgi?id=65322&redirect=false)):
Using a regex extractor post processor to extend a string on multiple consecutive http requests overwrite retains the value from the first cycle.
Example jmx attached.
This extracts a nonce value from the www.google.com page.
And uses the regex extractor template to extend the variable by using eg $1$,${varName} into variable varName.
With a single user the first cycle works fine, any further cycles use the variable value from the first cycle.
eg 4 requests and extractions
x.y x=cycle y=request/extraction
1.1 sr=Qpbt+0uVejJl85n00CiV1g==,
1.2 sr=kUmkC/WPIV4mTvP80A63Gw==,Qpbt+0uVejJl85n00CiV1g==,
1.3 sr=HL7tYTCY2GqGI8YSqRpd2Q==,kUmkC/WPIV4mTvP80A63Gw==,Qpbt+0uVejJl85n00CiV1g==,
1.4 sr=EGv3EuOu8HSeWx/dOwfAiw==,HL7tYTCY2GqGI8YSqRpd2Q==,kUmkC/WPIV4mTvP80A63Gw==,Qpbt+0uVejJl85n00CiV1g==,
2.1 sr=v5leXa60bmYOQbpI/ioi0g==,
2.2 expected sr=X0aaX9AxdZ7G9McEo/vXTg==,v5leXa60bmYOQbpI/ioi0g==,
2.2 actual sr=X0aaX9AxdZ7G9McEo/vXTg==,Qpbt+0uVejJl85n00CiV1g==, (The actual contains the first value extracted from the first cycle.)
2.3 expected sr=07jOJApf8MzXAlm/haarQw==,X0aaX9AxdZ7G9McEo/vXTg==,v5leXa60bmYOQbpI/ioi0g==,
2.3 actual sr=07jOJApf8MzXAlm/haarQw==,kUmkC/WPIV4mTvP80A63Gw==,Qpbt+0uVejJl85n00CiV1g==,
2.4 expected sr=Oy0acoIlBYVcRK5XNgElUg==,07jOJApf8MzXAlm/haarQw==,X0aaX9AxdZ7G9McEo/vXTg==,v5leXa60bmYOQbpI/ioi0g==,
2.4 actual sr=Oy0acoIlBYVcRK5XNgElUg==,HL7tYTCY2GqGI8YSqRpd2Q==,kUmkC/WPIV4mTvP80A63Gw==,Qpbt+0uVejJl85n00CiV1g==, (3 of these values are from the 1st cycle)
3.1 sr=71fUCP7haV72SdVTHnPfZg==,
3.2 expected sr=TGzD17A0JiXpDV46xX0ulg==,71fUCP7haV72SdVTHnPfZg==,
3.2 actual sr=TGzD17A0JiXpDV46xX0ulg==,Qpbt+0uVejJl85n00CiV1g==,
3.3 expected sr=jQ/DLNeG2W8RxhN/FN4UXQ==,TGzD17A0JiXpDV46xX0ulg==,71fUCP7haV72SdVTHnPfZg==,
3.3 actual sr=jQ/DLNeG2W8RxhN/FN4UXQ==,kUmkC/WPIV4mTvP80A63Gw==,Qpbt+0uVejJl85n00CiV1g==,
3.4 expected sr=OTqG6f79QKYEPowC971sog==,jQ/DLNeG2W8RxhN/FN4UXQ==,TGzD17A0JiXpDV46xX0ulg==,71fUCP7haV72SdVTHnPfZg==,
3.4 actual sr=OTqG6f79QKYEPowC971sog==,HL7tYTCY2GqGI8YSqRpd2Q==,kUmkC/WPIV4mTvP80A63Gw==,Qpbt+0uVejJl85n00CiV1g==, (again 3 of the values are from the 1st cycle)
Attached is a BUGSample.jmx which can be loaded and run to see the problem in the debug samplers wrapping the individual requests and the extractors.
Created attachment [BUGSample.jmx](https://apache.github.io/jmeter-bugzilla-attachments/22/65322/37874/BUGSample.jmx): A jmx that demonstrates the bug.
Severity: normal
OS: All
Contributor guide
Assessment
This issue has not been assessed yet.