jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nermin CALUK" <>
Subject How to map extracted pairs of var. names and var. values on the fly
Date Fri, 15 Apr 2011 08:14:25 GMT

I have a response in JMeter that looks like this:


i.e. pairs of "names" and "values". However, response in the brackets may
vary in terms of different names and number of items that appear inside and
even their order. Using regex extractor [{| ](.+?)=(.+?)[,|}] I can extract
each variable name (ex BYTES_READ) and each value (193) and they are stored
in groups, for example extr_4_g1=BYTES_READ  and  extr_4_g2=193

How can I create JMeter variables on the fly (${BYTES_READ}) and assign it
corresponding value (193)?  I want to avoid working with regex extracted
group variables (example: extr_4_g1) and I want to get more human readable
variables (example: BYTES_READ) to avoid any mistakes. The final result
should be, in this example, 4 JMeter variables (${NO_RECS_PROC}
${NO_RECS_PASS}  etc), corresponding values being assigned to them (12  11
etc), so I can use those human readable variables for further assertions

I have tried using Beanshell (loop that goes around as many times as there
are groups, vars.put, evalVar...) but no success because I'm not sure how to
do this on the fly. I.e. I tried lopping "extr_X_g1" where X ranges from 1
(first group) to the number of groups (this case 4) and using vars.put but
doesn't work probably because I was trying to nest JMeter's __evalVar${} in
Beanshell command...

There must be a more elegant way to do this :) I'd appreciate if someone can


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message