Reputation: 11
I have configured JDBC connection to mysql.
And I have added the JDBC sampler and a listener.
But I wanted to extract the details with regular expression extractor and then to enter into a foreach loop.
In ForEach loop, I wanted to execute a HTTP request.
My results window look as:
empid empname empDesgination
10 lee jrtester
10 lee MURAEE
123 lee MURAEE
1234567890 leeee MURALEE
1234567890 lee MURALEE
Please explain the following points:
As, with the information provided, i have worked on the JDBC, but it doesn't extracting the data and entering into loop. Could u please Explain what Exactly Regex expression we write to extract the above data. Where we give the Reference name as ${VAR_out}
for Http request sampler. Please expalin me the full flow with Regex, ForEach and Http Sampler.
Please provide me simple example on JDBC sampler Extracting data using Regular Expression Extractor and entering into the ForEach Loop.
Upvotes: 0
Views: 9769
Reputation: 83
I have recently worked this out, try the following steps:
Upvotes: 5
Reputation: 7707
To write a regular expression, please see this fantastic site: http://www.regular-expressions.info/ Jmeter uses PERL for it's regex and you'll find everything you need to know here. Also take a look at the manual for regular expression extractor on how to setup the controller. If you want to loop through every result, you'll want a negative match number (see manual).
The foreach controller manual can be slightly confusing at first. In the ForEach Input Variable
- enter the variable you declared in the Regular Expression Extractor under the Reference Name
. In the output field, enter the Variable reference for your sampler.
Roughly, something like this:
Regex controller:
Reference Name: VAR_in
For Each:
Input: VAR_in
Output: VAR_out
Sampler:
reference ${VAR_out}
Upvotes: 0