Bug 54897 - Variable defined by regular expression extractor can be used just in the next sampler
Summary: Variable defined by regular expression extractor can be used just in the next...
Status: RESOLVED WORKSFORME
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.9
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-26 16:43 UTC by Raymond Georg Snatzke
Modified: 2013-05-03 19:26 UTC (History)
0 users



Attachments
JMeter test case for a problem with the regular expression extractor (7.68 KB, application/octet-stream)
2013-04-26 16:43 UTC, Raymond Georg Snatzke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raymond Georg Snatzke 2013-04-26 16:43:22 UTC
Created attachment 30227 [details]
JMeter test case for a problem with the regular expression extractor

In the attechment the "Regular Expression Extractor” is used to extract a variable from the response of the last sampler, the debug sampler. The content of the extracted variable could be used just  in the very next sampler. The content was already gone in the next sampler thereafter, It also was not transferable to other variables or structures. I tried a whole bunch of different workarounds, none was working.

One note to what we did in this load test: We had to provide a filename to the String constructor of the JUnit test case. This file contained the test data for one execution of a JUnit test method. We had thousands of different files, and we wanted to choose it by random. So we wrote all the file names in a text file, loaded the content of the text file in the variable ${testfallDateiXMLTestCases}, displayed it with the Debug-Sampler (yeah, we know, that's not what this sampler is originally designed for) and chose one the lines (i.e. the name of one of the thousands of files with different test data) by random with the "Regular Expression Extractor". This line - the name of the test-data file - was put into the variable ${testfall}. It was this variable, that lost its content so quickly. 

Actually, this seems to be the very same bug as no. 28.600 from 2004... As this bug is so old and seemingly fixed, I create a new bug for this behaviour.
Comment 1 Sebb 2013-04-26 18:27:12 UTC
PostProcessors are applied to every sample in scope, not just the one they follow.

Bugzilla is not a support forum.

Please read [1]
If this does not solve your problem, please subscribe to the user list and ask there.

[1] http://jmeter.apache.org/usermanual/test_plan.html#scoping_rules
Comment 2 The ASF infrastructure team 2022-09-24 20:37:53 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3110