jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <>
Subject Re: User variables in Bean Shell
Date Mon, 08 Aug 2005 17:07:56 GMT
On 08/08/05, Miklos Tverdota <> wrote:
> Hi,
> 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
> parameters.
> 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$
>     bshInterpreter.set("vars",vars);//$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.

It does in the latest CVS, but in 2.0.3 there were some differences.
Check the Help file - I think that's accurate.

Try the nightly and see if the problem is fixed.

> Thanks,
> Miklos
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message