On 16 July 2012 16:50, unjc email <[email protected]> wrote:
> Hello,
>
> I have two thread groups set up in my test plan. The first test group
> is for initializing variables for the test plan at start; it is
> configured with a dummy debug sampler.
Should be a setUp Thread Group.
> The second group is where the
> actual test samplers are placed. I try to pass the variables from
> thread-group 1 via __setProperty to thread-group 2, but I always have
> "void" value from __P calls. Could someone please advise the proper
> way to pass variables from one group to another?
Should work using __setProperty/__P.
If it doesn't, double check the code.
>
> Test Plan (with 2 thread groups)
>
> Thread-Group1 (with 1 thread)
>> Dubug Sampler
>> BeanShell PreProcessor
> Script:
> tmp = "abc";
> ${__setProperty(key,tmp)};
> log.info("Group 1 key = " + ${__P(key)});
>
What is the value of 'key' here?
> Thread-Group2 (with 2 threads)
>> HTTP Sampler
>> BeanShell PreProcessor
> Script:
> log.info("Group 2 key = " + ${__P(key)});
>
What is the value of 'key' here?
Are you 100% sure the key variables have the same value?
Have you logged the key values?
> 2012/07/16 15:47:32 INFO - jmeter.threads.JMeterThread: Thread
> started: Thread Group 1-1
> 2012/07/16 15:47:32 INFO - jmeter.threads.JMeterThread: Thread
> started: Thread Group 2-1
> 2012/07/16 15:47:32 INFO - jmeter.util.BeanShellTestElement: Group 1 key =
> abc
> 2012/07/16 15:47:32 INFO - jmeter.threads.JMeterThread: Thread
> finished: Thread Group 1-1
> 2012/07/16 15:47:32 INFO - jmeter.engine.StandardJMeterEngine: Ending
> thread Thread Group 1-1
> 2012/07/16 15:47:32 INFO - jmeter.engine.StandardJMeterEngine: All
> threads have been started
> 2012/07/16 15:47:32 INFO - jmeter.threads.JMeterThread: Thread
> started: Thread Group 2-2
> 2012/07/16 15:47:32 INFO - jmeter.util.BeanShellTestElement: Group 2
> key = void
> 2012/07/16 15:47:32 INFO - jmeter.threads.JMeterThread: Thread
> finished: Thread Group 2-1
> 2012/07/16 15:47:32 INFO - jmeter.engine.StandardJMeterEngine: Ending
> thread Thread Group 2-1
> 2012/07/16 15:47:32 INFO - jmeter.util.BeanShellTestElement: Group 2
> key = void
> 2012/07/16 15:47:32 INFO - jmeter.threads.JMeterThread: Thread
> finished: Thread Group 2-2
> 2012/07/16 15:47:32 INFO - jmeter.engine.StandardJMeterEngine: Ending
> thread Thread Group 2-2
>
>
>
>
> Thanks,
> Jacky
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]