jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Miklos Tverdota <>
Subject User variables in Bean Shell
Date Mon, 08 Aug 2005 14:00:18 GMT

The version is JMeter 2.0.3.
I use BeanShell from response assertion.

I have some user variables  global direct  as children of the thread 
group.  I already catch some response parameters with the reqular 
expression extractors.
They are saved in User Variables.  If some request is executed and the 
result is fail, I want to write the  session_id, custommer, and some 
others parameters in the log file.
They are  can be wrong constemer or some other problem.  The test works 
fine with some customers. I have a long customer list and I want ot pick 
up the wrong ones.
It is not possible to track each of them.

To do this, I  need the value of the variables.  This is all about.  I 
could not find out how to get it. The context is passed to the Bean 
Shell, but I am not able to use it.
I supposed it is possible to get the values simmilar to the response 

This code is from response assertion:

// Add variables for access to context and variables  (no variable is transfered)
     JMeterContext jmctx = JMeterContextService.getContext();
     JMeterVariables vars = jmctx.getVariables();
     bshInterpreter.set("ctx",jmctx);  //$NON-NLS-1$

Jmeter use  the same code everyvere to tranfer the ResposeCode and the 
variables.  Unfortunately I can use the ResponseCode but I can not reach 
the User variables.



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

View raw message