You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Pavel Gouchtchine <gu...@gmail.com> on 2005/09/30 15:03:47 UTC

HOW TO Transfering data between Thread?

Hi All.
I have a task, what I don't know solution - I need generate a variable with
a value and then use this variable in user parameters pre-processor. I am
using BeenShell sampler for generation data and jmeter context variables to
set it in.
Because user parameters preprocessor is running before any sampler, my
approach doesn't work.

I have tried to create two thread groups in test plan - one for generating
data, and the second is actually the test. I am unable to transfer data via
context between the thread groups.
If somebody knows how to do it - please let me know.

I have tried to create two thread groups under a "main" thread groups. I was
able to use the same context for the transferring generated data but these
two thread groups were running twice even the settings were set for all of
them to run once.

I will really appreciate any ideas and advices.

Thank you, very much.
Pavel

Re: HOW TO Transfering data between Thread?

Posted by Pavel Gouchtchine <gu...@gmail.com>.
Hello again.

I am still looking for posibility to transfer data between thread groups
using API.
Does anybody have idea how to do it using api?

Does anybody know, how to make a sampler be executed before a pre-processor?

Thank you.
Pavel


On 9/30/05, sebb <se...@gmail.com> wrote:
>
> On 30/09/05, Pavel Gouchtchine <gu...@gmail.com> wrote:
> > If pre-processor is a child of a bean shell sampler, the pre-processor
> is
> > called first any way.
> >
> > Here is my scenario:
> >
> > - BeanShell sampler sets variabel unique_string = qwerty
> > --- child pre - processor sets the variable account = ${unique_string}
> >
> > the account gets value "${unique_string}" but I am expecint the value to
> be
> > "qwerty"
>
> This is because the variable "unique_string" does not exist at that point.
>
> > Please help.
>
> What are you trying to achieve?
>
> >
> > Pavel
> >
> > On 9/30/05, sebb <se...@gmail.com> wrote:
> > > The pre-processor can be added as a child of a sampler, e.g.
> > >
> > > - Sampler 1
> > > - Sampler 2
> > > - - Pre-Processor
> > >
> > > This will force it to run after Sampler 1 and before Sampler 2.
> > >
> > > Or you can put:
> > >
> > > Simple Controller
> > > - Sampler 1
> > > Simple Controller
> > > - Pre-Processor
> > > - Sampler 2
> > >
> > > What are you trying to achieve?
> > > The CSV Data Set config element might well suit the task better.
> > >
> > > S.
> > > On 30/09/05, Pavel Gouchtchine < guserlist@gmail.com> wrote:
> > > > Hi All.
> > > > I have a task, what I don't know solution - I need generate a
> variable
> > with
> > > > a value and then use this variable in user parameters pre-processor.
> I
> > am
> > > > using BeenShell sampler for generation data and jmeter context
> variables
> > to
> > > > set it in.
> > > > Because user parameters preprocessor is running before any sampler,
> my
> > > > approach doesn't work.
> > > >
> > > > I have tried to create two thread groups in test plan - one for
> > generating
> > > > data, and the second is actually the test. I am unable to transfer
> data
> > via
> > > > context between the thread groups.
> > > > If somebody knows how to do it - please let me know.
> > > >
> > > > I have tried to create two thread groups under a "main" thread
> groups. I
> > was
> > > > able to use the same context for the transferring generated data but
> > these
> > > > two thread groups were running twice even the settings were set for
> all
> > of
> > > > them to run once.
> > > >
> > > > I will really appreciate any ideas and advices.
> > > >
> > > > Thank you, very much.
> > > > Pavel
> > > >
> > > >
> > >
> >
> >
>

Re: HOW TO Transfering data between Thread?

Posted by Pavel Gouchtchine <gu...@gmail.com>.
I tried the scenario you have described:

=====================
The pre-processor can be added as a child of a sampler, e.g.

- Sampler 1
- Sampler 2
- - Pre-Processor

This will force it to run after Sampler 1 and before Sampler 2.
======================

In my case, "Sampler 2" is Bean Shell script that makes the following call
on a context variablel:
vars.put("unique_word",uniqueWord);

User Parameter pre-processor is a child of that bean shell script. The
pre-processor is trying to set
account = ${unique_string}

Is there any solutions or advises to that problem?


On 9/30/05, sebb <se...@gmail.com> wrote:
>
> On 30/09/05, Pavel Gouchtchine <gu...@gmail.com> wrote:
> > If pre-processor is a child of a bean shell sampler, the pre-processor
> is
> > called first any way.
> >
> > Here is my scenario:
> >
> > - BeanShell sampler sets variabel unique_string = qwerty
> > --- child pre - processor sets the variable account = ${unique_string}
> >
> > the account gets value "${unique_string}" but I am expecint the value to
> be
> > "qwerty"
>
> This is because the variable "unique_string" does not exist at that point.
>
> > Please help.
>
> What are you trying to achieve?
>
> >
> > Pavel
> >
> > On 9/30/05, sebb <se...@gmail.com> wrote:
> > > The pre-processor can be added as a child of a sampler, e.g.
> > >
> > > - Sampler 1
> > > - Sampler 2
> > > - - Pre-Processor
> > >
> > > This will force it to run after Sampler 1 and before Sampler 2.
> > >
> > > Or you can put:
> > >
> > > Simple Controller
> > > - Sampler 1
> > > Simple Controller
> > > - Pre-Processor
> > > - Sampler 2
> > >
> > > What are you trying to achieve?
> > > The CSV Data Set config element might well suit the task better.
> > >
> > > S.
> > > On 30/09/05, Pavel Gouchtchine < guserlist@gmail.com> wrote:
> > > > Hi All.
> > > > I have a task, what I don't know solution - I need generate a
> variable
> > with
> > > > a value and then use this variable in user parameters pre-processor.
> I
> > am
> > > > using BeenShell sampler for generation data and jmeter context
> variables
> > to
> > > > set it in.
> > > > Because user parameters preprocessor is running before any sampler,
> my
> > > > approach doesn't work.
> > > >
> > > > I have tried to create two thread groups in test plan - one for
> > generating
> > > > data, and the second is actually the test. I am unable to transfer
> data
> > via
> > > > context between the thread groups.
> > > > If somebody knows how to do it - please let me know.
> > > >
> > > > I have tried to create two thread groups under a "main" thread
> groups. I
> > was
> > > > able to use the same context for the transferring generated data but
> > these
> > > > two thread groups were running twice even the settings were set for
> all
> > of
> > > > them to run once.
> > > >
> > > > I will really appreciate any ideas and advices.
> > > >
> > > > Thank you, very much.
> > > > Pavel
> > > >
> > > >
> > >
> >
> >
>

Re: HOW TO Transfering data between Thread?

Posted by sebb <se...@gmail.com>.
On 30/09/05, Pavel Gouchtchine <gu...@gmail.com> wrote:
> If pre-processor is a child of a bean shell sampler, the pre-processor is
> called first any way.
>
> Here is my scenario:
>
> - BeanShell sampler sets variabel unique_string = qwerty
> --- child pre - processor sets the variable account = ${unique_string}
>
> the account gets value "${unique_string}" but I am expecint the value to be
> "qwerty"

This is because the variable "unique_string" does not exist at that point.

> Please help.

What are you trying to achieve?

>
> Pavel
>
> On 9/30/05, sebb <se...@gmail.com> wrote:
> > The pre-processor can be added as a child of a sampler, e.g.
> >
> > - Sampler 1
> > - Sampler 2
> > - - Pre-Processor
> >
> > This will force it to run after Sampler 1 and before Sampler 2.
> >
> > Or you can put:
> >
> > Simple Controller
> > - Sampler 1
> > Simple Controller
> > - Pre-Processor
> > - Sampler 2
> >
> > What are you trying to achieve?
> > The CSV Data Set config element might well suit the task better.
> >
> > S.
> > On 30/09/05, Pavel Gouchtchine < guserlist@gmail.com> wrote:
> > > Hi All.
> > > I have a task, what I don't know solution - I need generate a variable
> with
> > > a value and then use this variable in user parameters pre-processor. I
> am
> > > using BeenShell sampler for generation data and jmeter context variables
> to
> > > set it in.
> > > Because user parameters preprocessor is running before any sampler, my
> > > approach doesn't work.
> > >
> > > I have tried to create two thread groups in test plan - one for
> generating
> > > data, and the second is actually the test. I am unable to transfer data
> via
> > > context between the thread groups.
> > > If somebody knows how to do it - please let me know.
> > >
> > > I have tried to create two thread groups under a "main" thread groups. I
> was
> > > able to use the same context for the transferring generated data but
> these
> > > two thread groups were running twice even the settings were set for all
> of
> > > them to run once.
> > >
> > > I will really appreciate any ideas and advices.
> > >
> > > Thank you, very much.
> > > Pavel
> > >
> > >
> >
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: HOW TO Transfering data between Thread?

Posted by Pavel Gouchtchine <gu...@gmail.com>.
As well, how to read/write from a bean shell script:

a) property
b) user defined variables

in run time.

Can you give an example if it is possible?


On 9/30/05, Pavel Gouchtchine <gu...@gmail.com> wrote:
>
> If pre-processor is a child of a bean shell sampler, the pre-processor is
> called first any way.
>
> Here is my scenario:
>
> - BeanShell sampler sets variabel unique_string = qwerty
> --- child pre - processor sets the variable account = ${unique_string}
>
> the account gets value "${unique_string}" but I am expecint the value to
> be "qwerty"
>
> Please help.
>
> Pavel
>
> On 9/30/05, sebb <se...@gmail.com> wrote:
> >
> > The pre-processor can be added as a child of a sampler, e.g.
> >
> > - Sampler 1
> > - Sampler 2
> > - - Pre-Processor
> >
> > This will force it to run after Sampler 1 and before Sampler 2.
> >
> > Or you can put:
> >
> > Simple Controller
> > - Sampler 1
> > Simple Controller
> > - Pre-Processor
> > - Sampler 2
> >
> > What are you trying to achieve?
> > The CSV Data Set config element might well suit the task better.
> >
> > S.
> > On 30/09/05, Pavel Gouchtchine < guserlist@gmail.com> wrote:
> > > Hi All.
> > > I have a task, what I don't know solution - I need generate a variable
> > with
> > > a value and then use this variable in user parameters pre-processor. I
> > am
> > > using BeenShell sampler for generation data and jmeter context
> > variables to
> > > set it in.
> > > Because user parameters preprocessor is running before any sampler, my
> > > approach doesn't work.
> > >
> > > I have tried to create two thread groups in test plan - one for
> > generating
> > > data, and the second is actually the test. I am unable to transfer
> > data via
> > > context between the thread groups.
> > > If somebody knows how to do it - please let me know.
> > >
> > > I have tried to create two thread groups under a "main" thread groups.
> > I was
> > > able to use the same context for the transferring generated data but
> > these
> > > two thread groups were running twice even the settings were set for
> > all of
> > > them to run once.
> > >
> > > I will really appreciate any ideas and advices.
> > >
> > > Thank you, very much.
> > > Pavel
> > >
> > >
> >
>
>

Re: HOW TO Transfering data between Thread?

Posted by Pavel Gouchtchine <gu...@gmail.com>.
If pre-processor is a child of a bean shell sampler, the pre-processor is
called first any way.

Here is my scenario:

- BeanShell sampler sets variabel unique_string = qwerty
--- child pre - processor sets the variable account = ${unique_string}

the account gets value "${unique_string}" but I am expecint the value to be
"qwerty"

Please help.

Pavel

On 9/30/05, sebb <se...@gmail.com> wrote:
>
> The pre-processor can be added as a child of a sampler, e.g.
>
> - Sampler 1
> - Sampler 2
> - - Pre-Processor
>
> This will force it to run after Sampler 1 and before Sampler 2.
>
> Or you can put:
>
> Simple Controller
> - Sampler 1
> Simple Controller
> - Pre-Processor
> - Sampler 2
>
> What are you trying to achieve?
> The CSV Data Set config element might well suit the task better.
>
> S.
> On 30/09/05, Pavel Gouchtchine <gu...@gmail.com> wrote:
> > Hi All.
> > I have a task, what I don't know solution - I need generate a variable
> with
> > a value and then use this variable in user parameters pre-processor. I
> am
> > using BeenShell sampler for generation data and jmeter context variables
> to
> > set it in.
> > Because user parameters preprocessor is running before any sampler, my
> > approach doesn't work.
> >
> > I have tried to create two thread groups in test plan - one for
> generating
> > data, and the second is actually the test. I am unable to transfer data
> via
> > context between the thread groups.
> > If somebody knows how to do it - please let me know.
> >
> > I have tried to create two thread groups under a "main" thread groups. I
> was
> > able to use the same context for the transferring generated data but
> these
> > two thread groups were running twice even the settings were set for all
> of
> > them to run once.
> >
> > I will really appreciate any ideas and advices.
> >
> > Thank you, very much.
> > Pavel
> >
> >
>

Re: HOW TO Transfering data between Thread?

Posted by sebb <se...@gmail.com>.
The pre-processor can be added as a child of a sampler, e.g.

- Sampler 1
- Sampler 2
- - Pre-Processor

This will force it to run after Sampler 1 and before Sampler 2.

Or you can put:

Simple Controller
- Sampler 1
Simple Controller
- Pre-Processor
- Sampler 2

What are you trying to achieve?
The CSV Data Set config element might well suit the task better.

S.
On 30/09/05, Pavel Gouchtchine <gu...@gmail.com> wrote:
> Hi All.
> I have a task, what I don't know solution - I need generate a variable with
> a value and then use this variable in user parameters pre-processor. I am
> using BeenShell sampler for generation data and jmeter context variables to
> set it in.
> Because user parameters preprocessor is running before any sampler, my
> approach doesn't work.
>
> I have tried to create two thread groups in test plan - one for generating
> data, and the second is actually the test. I am unable to transfer data via
> context between the thread groups.
> If somebody knows how to do it - please let me know.
>
> I have tried to create two thread groups under a "main" thread groups. I was
> able to use the same context for the transferring generated data but these
> two thread groups were running twice even the settings were set for all of
> them to run once.
>
> I will really appreciate any ideas and advices.
>
> Thank you, very much.
> Pavel
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org