You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Standa Černý <st...@gmail.com> on 2012/09/21 13:22:07 UTC
Regular Expression Extractor in loop
Hi!
I need to extract values from response several times and number of
repeating depend on value FEATURECOUNT which I'm also extracting from
answer. I looking for lowest xmin, ymin, and for highest xmax and ymax
values from all the features. Could I use While Controller or some other
logic element to loop through and find min a max values?
Response looks like this:
var XMLResponse='
<?xml version="1.0" encoding="UTF-8"?>
<ARCXML version="1.1">
<RESPONSE>
<FEATURES>
<FEATURE>
<ENVELOPE minx="-730691,1005" miny="-1053035,2805" maxx="-730650,23"
maxy="-1052997,1"/>
<FIELDS ... />
</FEATURE>
<FEATURE>
<ENVELOPE minx="-730670,6305" miny="-1053018,2505" maxx="-730649,71"
maxy="-1052995,55"/>
<FIELDS ... />
</FEATURE>
<FEATURE>
<ENVELOPE minx="-730678,26" miny="-1053020,5905" maxx="-730662,96"
maxy="-1053002,6095"/>
<FIELDS ..
</FEATURE>
<FEATURECOUNT count="3" hasmore="false" />
</FEATURES>
</RESPONSE>
</ARCXML>...
And it could have as much as 25 features.
Re: Regular Expression Extractor in loop
Posted by sebb <se...@gmail.com>.
On 21 September 2012 12:22, Standa Černý <st...@gmail.com> wrote:
> Hi!
> I need to extract values from response several times and number of
> repeating depend on value FEATURECOUNT which I'm also extracting from
> answer. I looking for lowest xmin, ymin, and for highest xmax and ymax
> values from all the features. Could I use While Controller or some other
> logic element to loop through and find min a max values?
Sounds like a job for the XPath extractor [1]
You will need to use one for each output variable.
Alternatively, you can extract the values using the RE post-processor,
but you will have to write a BSH or BSF or JSR223 script to calculate
the minima and maxima. Or you can do it all in the script. Search the
list for how to use these elements.
[1]http://jmeter.apache.org/usermanual/component_reference.html#XPath_Extractor
> Response looks like this:
> var XMLResponse='
> <?xml version="1.0" encoding="UTF-8"?>
> <ARCXML version="1.1">
> <RESPONSE>
> <FEATURES>
> <FEATURE>
> <ENVELOPE minx="-730691,1005" miny="-1053035,2805" maxx="-730650,23"
> maxy="-1052997,1"/>
> <FIELDS ... />
> </FEATURE>
> <FEATURE>
> <ENVELOPE minx="-730670,6305" miny="-1053018,2505" maxx="-730649,71"
> maxy="-1052995,55"/>
> <FIELDS ... />
> </FEATURE>
> <FEATURE>
> <ENVELOPE minx="-730678,26" miny="-1053020,5905" maxx="-730662,96"
> maxy="-1053002,6095"/>
> <FIELDS ..
> </FEATURE>
> <FEATURECOUNT count="3" hasmore="false" />
> </FEATURES>
> </RESPONSE>
> </ARCXML>...
>
> And it could have as much as 25 features.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org