You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Bryan Li <br...@gmail.com> on 2007/12/11 23:46:27 UTC

Command Line Argument Passing

Hi all,

I'm wondering if there's a command line argument I can use to pass an
variable to JMeter that later can be extracted in the test plan, ie, if I
run JMeter in the non-GUI mode,

java -jar ApacheJMeter.jar -n -Xabc_host=127.0.0.1, then in the JMeter test
plan, I can extract the value of abc_host with ${abc_host}.

Is there a way to do this? I tried -J but it doesn't seem to work. It only
changes the JMeter properties which are already defined.

Thanks,
Bryan

Re: Command Line Argument Passing

Posted by sebb <se...@gmail.com>.
On 11/12/2007, Bryan Li <br...@gmail.com> wrote:
> Hi all,
>
> I'm wondering if there's a command line argument I can use to pass an
> variable to JMeter that later can be extracted in the test plan, ie, if I
> run JMeter in the non-GUI mode,
>
> java -jar ApacheJMeter.jar -n -Xabc_host=127.0.0.1, then in the JMeter test
> plan, I can extract the value of abc_host with ${abc_host}.
>
> Is there a way to do this? I tried -J but it doesn't seem to work. It only
> changes the JMeter properties which are already defined.

The -J option sets JMeter properties; access them with the __P() function:

http://jakarta.apache.org/jmeter/usermanual/functions.html

JMeter variables cannot be set from the command-line.


> Thanks,
> Bryan
>

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