This is the way I pass parameters from Ant to JMeter:
a) I run Ant from the a batch file:
>> runBat www.mysite.com 5 10
The batch file looks like:
ant -f "C:\LoadTest\Run\run.xml" -Dhost= %1 -DnumberOfUsers= %2 -DrampUp= %3
b) The Ant task is an xml file that looks like this:
<?xml version="1.0"?>
<project name="Orion Load Test" basedir=".">
<taskdef name="jmeter"
classname="org.programmerplanet.ant.taskdefs.jmeter.JMeterTask"/>
<jmeter
jmeterhome="C:/jakarta-jmeter-2.3.4"
<property name="request.threads" value="${numberOfUsers}"/>
<property name="test.host" value="${host}"/>
<property name="loadtest.rampUp" value="${rampUp}"/>
</jmeter>
</project>
c) In the user.properties file I added the delay property like this:
loadtest.rampUp=""
d) Finally I added the following to the JMeter plan where needed:
${__P(test.host)}
${__P(request.threads)}
${__P(loadtest.rampUp)}
I hope this helps,
Rodolfo
On Sat, Mar 6, 2010 at 10:55 PM, Anamika aaa <anamikaqtp@gmail.com> wrote:
> Hi
> I am also trying to run the Jmeter using Ant build file but can u pls
> tell me how to pass the number of threads and server name from outside .jmx
> file ?
>
> Thanks in advance
>
>
>
> On Thu, Mar 4, 2010 at 7:24 AM, sebb <sebbaz@gmail.com> wrote:
>
> > On 03/03/2010, Rodolfo Landa <rodolfo.landa@gmail.com> wrote:
> > > All,
> > >
> > > I use JMeter Ant Task to run test plans. I pass the number of threads
> > and
> > > loops like this:
> > >
> > > <property name="request.threads" value="1">
> > > <property name="request.loop" value="10">
> > >
> > > I cannot find how to pass the Ramp-Up period. Have someone done it
> > before or
> > > knows the name of this property?
> >
> > I don't know - the JMeter Ant task is not part of JMeter.
> >
> > However, you can just define the ramp-up using a property -
> > ${__P(request.rampup)} - in the test plan and then pass in the
> > property instead.
> >
> > > Thanks in advance.
> > >
> > >
> > > Rodolfo
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
|