You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Bhavesh Chheda <bh...@gmail.com> on 2008/04/25 23:45:55 UTC

Executing a sampler/pre-processor truly once only

hi, I have a utility task that before every run that generates new user
accounts in the database. If these accounts already exists then it will
reuse them. I want to run this task only once regardless of the number of
threads, loops configured for the test plan. You can say that it is a setup
task for the jmeter script. I tried various options but it didn't work for
me. For instance I tried creating a sampler under run once-only controller.
But it executes for each thread. I tried creating a sampler in a different
thread group but that didn't help either. As it launches this sampler and
sampler in other thread group simultaneously. I thought I'll try to put all
the samplers under if-controller that checks for certain variable set by the
sampler but that didn't work either. Like I said I want run this task once
and once only irrespective of the number of threads/users/loops. I could run
it before launching the jmeter script but I thought it would be cleaner if
it can be part of jmeter configuration.

I'd appreciate If anyone has any suggestion?

Thanks!

B.C.

PS: I apologize if this question has been asked and answered before. I
couldn't find the search functionality and I browsed the archives for last
few months but didn't find anything relevant.

Re: Executing a sampler/pre-processor truly once only

Posted by sebb <se...@gmail.com>.
2008/4/25 Bhavesh Chheda <bh...@gmail.com>:
> hi, I have a utility task that before every run that generates new user
>  accounts in the database. If these accounts already exists then it will
>  reuse them. I want to run this task only once regardless of the number of
>  threads, loops configured for the test plan. You can say that it is a setup
>  task for the jmeter script. I tried various options but it didn't work for
>  me. For instance I tried creating a sampler under run once-only controller.
>  But it executes for each thread. I tried creating a sampler in a different
>  thread group but that didn't help either. As it launches this sampler and
>  sampler in other thread group simultaneously.

Just change the Test Plan to run the Thread Groups in sequence.

> I thought I'll try to put all
>  the samplers under if-controller that checks for certain variable set by the
>  sampler but that didn't work either. Like I said I want run this task once
>  and once only irrespective of the number of threads/users/loops. I could run
>  it before launching the jmeter script but I thought it would be cleaner if
>  it can be part of jmeter configuration.
>
>  I'd appreciate If anyone has any suggestion?
>
>  Thanks!
>
>  B.C.
>
>  PS: I apologize if this question has been asked and answered before. I
>  couldn't find the search functionality and I browsed the archives for last
>  few months but didn't find anything relevant.
>

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