You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Vic <vi...@pandora.com> on 2006/11/23 00:57:20 UTC
Passing global parameters to a jmx file
Is there an easy way to pass user defined parameters (such as server, port,
thread count, duration) to a jmeter test from the command line?
I have been struggling with this problem for some time now. Here is what I
have tried:
I have a shell script that takes arguments for server, port, threads, and
duration parameters. It then writes them to a temporary csv file. It then
excecutes the jmeter test which pulls the values from the csv using a top
level "csv data set config" element.
The problem is that the "threads" and "duration" values don't get passed
down to the child "thread group" in my test, which expects them in the
"Number of threads" and "Duration (seconds)" fields. I can't seem to figure
out why. The "server" and "port" values work when accessed in the "HTTP
Request Defaults" element (a child of the thread group). Does the scope of
those variables only apply to children of the thread groups?
--
View this message in context: http://www.nabble.com/Passing-global-parameters-to-a-jmx-file-tf2689686.html#a7500470
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: Passing global parameters to a jmx file
Posted by Vic <vi...@pandora.com>.
Thank you... that's precisely what I needed. For the curious, here is what I
did:
The command looked like this:
jmeter -n mytest.jmx -Jserver=qa.test.com -Jport=80 -Jthreads=100
-Jduration=120
And in my top level "User Defined Variables" in the test, I specified:
server=${__P(server)}
port=${__P(port)}
threads=${__P(threads)}
duration=${__P(duration)}
sebb-2 wrote:
>
> You can define properties on the command-line using the -J
> property=value qualifier, and then refer to them using the __P()
> function:
>
> http://jakarta.apache.org/jmeter/usermanual/functions.html#__P
>
> S.
> On 22/11/06, Vic <vi...@pandora.com> wrote:
>>
>> Is there an easy way to pass user defined parameters (such as server,
>> port,
>> thread count, duration) to a jmeter test from the command line?
>>
>> I have been struggling with this problem for some time now. Here is what
>> I
>> have tried:
>>
>> I have a shell script that takes arguments for server, port, threads, and
>> duration parameters. It then writes them to a temporary csv file. It then
>> excecutes the jmeter test which pulls the values from the csv using a top
>> level "csv data set config" element.
>>
>> The problem is that the "threads" and "duration" values don't get passed
>> down to the child "thread group" in my test, which expects them in the
>> "Number of threads" and "Duration (seconds)" fields. I can't seem to
>> figure
>> out why. The "server" and "port" values work when accessed in the "HTTP
>> Request Defaults" element (a child of the thread group). Does the scope
>> of
>> those variables only apply to children of the thread groups?
>> --
>> View this message in context:
>> http://www.nabble.com/Passing-global-parameters-to-a-jmx-file-tf2689686.html#a7500470
>> Sent from the JMeter - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Passing-global-parameters-to-a-jmx-file-tf2689686.html#a7500790
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: Passing global parameters to a jmx file
Posted by sebb <se...@gmail.com>.
You can define properties on the command-line using the -J
property=value qualifier, and then refer to them using the __P()
function:
http://jakarta.apache.org/jmeter/usermanual/functions.html#__P
S.
On 22/11/06, Vic <vi...@pandora.com> wrote:
>
> Is there an easy way to pass user defined parameters (such as server, port,
> thread count, duration) to a jmeter test from the command line?
>
> I have been struggling with this problem for some time now. Here is what I
> have tried:
>
> I have a shell script that takes arguments for server, port, threads, and
> duration parameters. It then writes them to a temporary csv file. It then
> excecutes the jmeter test which pulls the values from the csv using a top
> level "csv data set config" element.
>
> The problem is that the "threads" and "duration" values don't get passed
> down to the child "thread group" in my test, which expects them in the
> "Number of threads" and "Duration (seconds)" fields. I can't seem to figure
> out why. The "server" and "port" values work when accessed in the "HTTP
> Request Defaults" element (a child of the thread group). Does the scope of
> those variables only apply to children of the thread groups?
> --
> View this message in context: http://www.nabble.com/Passing-global-parameters-to-a-jmx-file-tf2689686.html#a7500470
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org