It should be possible to pass objects between sampler in the same
thread using JMeter variables.

However, JMeter variables can only be strings when using get() and put().

You need to use putObject() and getObject() to work with other classes.

e.g.

vars.putObject("date",new Date()):
...
vars.getObject("date");


On 30/06/06, Vikrant Sharma <[EMAIL PROTECTED]> wrote:
Hi Vitalie,

Thanks for the reply.

When i try to store the object into a variable (in first beanshell) using 
vars.put("varname", "value"); method, it does not complain about anything.
But when I get it (in second beanshell) using vars.get("varname") method and 
try to cast it, it throws error.
Further  when i dont cast it and try to print it. it just prints the name of 
that object as a normal String. SO I think when we set the object in the 
variable it is just set as a normal String and not as an object instance.

For the second solution, yes i can serialize the object but as this is the 
performance script, storing and loading object's state will incur some more 
cost.

Thanks & Regards
Vikrant

Vitalie Valache <[EMAIL PROTECTED]> wrote: just some ideas..
- maybe you can declare a global variable assign the object value to it and use 
it by casting in the second beanshell, not sure if jmeter variable can store 
objects but why not!

or
- save object  to a file using serialization if your object is supporting and 
load it from your second beanshell.


--
DISCLAIMER:
Any e-mail messages from the National Bank of Moldova are sent in good faith, 
but shall not be binding nor construed as constituting any obligation on the 
part of the Bank.
The information transmitted is intended only for the person or entity to which 
it is addressed and may contain confidential and/or privileged material. If you 
received this in error, please contact the sender and delete the material from 
any computer.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ 
countries) for 2ยข/min or less.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to