You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Aleksandar Stoisavljevic <st...@gmail.com> on 2010/09/03 11:48:54 UTC

JMeter: 10 Users using HTTP Request sending different files with POST method

Hi all,

I was wondering if someone can help me in building following UseCase
scenario:

I want to have 10 HTTP requests (simulating 10 users) that is trying to send
10 different XML files using HTTP POST method.

I want to stress test application, reaching peak of 10 users using web
application at one time.


To give you more info where I am stucked, see following what I have done
until now:

1. I have created one 'Thread Group' and entered Number of Threads (users) :
10, Ramp-Up Period: 0 (I want to send all messages at once)

2. All requests will be sent to same server, same servlet so I have added
'HTTP Request Defaults'. I filled up fields: 'Server name', 'Port' and
'Path'. That won't change.

3. Then I have added Recording Controller and added one HTTP Request
Sampler. I've set the Method 'POST'. Now we are comming to the point.
At the bottom of HTTP Request screen there is option to add 'Sending files
with Request:'. But for different Users this file will be different. e.g
on file system I prepared those files msg_no1.xml, msg_no2.xml, .etc
Is it possible to assign different files to different threads ?

any help would be appreciated

Thank You




-- 
Aleksandar dipl. ing. Stoisavljevic
Software Developer
mobile: +381 (0) 64 211 50 40
Web: http://www.staleksit.in.rs
E-mail:staleks@gmail.com <E-...@gmail.com>
SkypeId: staleks_ns
Mail: Branislava Nusica 10, 21000 Novi Sad, Serbia

Re: JMeter: 10 Users using HTTP Request sending different files with POST method

Posted by sebb <se...@gmail.com>.
On 3 September 2010 11:22, Aleksandar Stoisavljevic <st...@gmail.com> wrote:
> OK, I will give it a try. I noticed that you set double underscore __, but
> what about brackets ()  ?  maybe ${__threadNum()} ??

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

>
> On Fri, Sep 3, 2010 at 12:19 PM, Felix Frank <ff...@mpexnet.de> wrote:
>
>> On 09/03/10 12:09, Aleksandar Stoisavljevic wrote:
>> > Thanks Frank,
>>
>> It's "Felix". (But people are confused all the time, no blame).
>>
>> > I see from documentation that this variable (_threadNum) won't me any
>> good
>> > in CSV Dataset config. If I understood correctly ?
>> >
>> > I was wondering if I can use that variable directly in definition of file
>> > path ?
>> >
>> > e.g. in HTTP Request sampler when I am defining wich file should be used
>> and
>> > to have something like
>> >
>> > /home/astoisavljevic/jmeter-test/msg_${_threadNum}.xml ?
>> >
>> > Is it valid ?
>>
>> It should be (and was in fact my original proposal). Just give it a shot.
>>
>> Caution: Double underscore in the name: ${__threadNum}, not ${_threadNum}.
>>
>> Cheers,
>> Felix
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>
>>
>
>
> --
> Aleksandar dipl. ing. Stoisavljevic
> Software Developer
> mobile: +381 (0) 64 211 50 40
> Web: http://www.staleksit.in.rs
> E-mail:staleks@gmail.com <E-...@gmail.com>
> SkypeId: staleks_ns
> Mail: Branislava Nusica 10, 21000 Novi Sad, Serbia
>

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


Re: JMeter: 10 Users using HTTP Request sending different files with POST method

Posted by Aleksandar Stoisavljevic <st...@gmail.com>.
OK, I will give it a try. I noticed that you set double underscore __, but
what about brackets ()  ?  maybe ${__threadNum()} ??


On Fri, Sep 3, 2010 at 12:19 PM, Felix Frank <ff...@mpexnet.de> wrote:

> On 09/03/10 12:09, Aleksandar Stoisavljevic wrote:
> > Thanks Frank,
>
> It's "Felix". (But people are confused all the time, no blame).
>
> > I see from documentation that this variable (_threadNum) won't me any
> good
> > in CSV Dataset config. If I understood correctly ?
> >
> > I was wondering if I can use that variable directly in definition of file
> > path ?
> >
> > e.g. in HTTP Request sampler when I am defining wich file should be used
> and
> > to have something like
> >
> > /home/astoisavljevic/jmeter-test/msg_${_threadNum}.xml ?
> >
> > Is it valid ?
>
> It should be (and was in fact my original proposal). Just give it a shot.
>
> Caution: Double underscore in the name: ${__threadNum}, not ${_threadNum}.
>
> Cheers,
> Felix
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>


-- 
Aleksandar dipl. ing. Stoisavljevic
Software Developer
mobile: +381 (0) 64 211 50 40
Web: http://www.staleksit.in.rs
E-mail:staleks@gmail.com <E-...@gmail.com>
SkypeId: staleks_ns
Mail: Branislava Nusica 10, 21000 Novi Sad, Serbia

Re: JMeter: 10 Users using HTTP Request sending different files with POST method

Posted by Felix Frank <ff...@mpexnet.de>.
On 09/03/10 12:09, Aleksandar Stoisavljevic wrote:
> Thanks Frank,

It's "Felix". (But people are confused all the time, no blame).

> I see from documentation that this variable (_threadNum) won't me any good
> in CSV Dataset config. If I understood correctly ?
> 
> I was wondering if I can use that variable directly in definition of file
> path ?
> 
> e.g. in HTTP Request sampler when I am defining wich file should be used and
> to have something like
> 
> /home/astoisavljevic/jmeter-test/msg_${_threadNum}.xml ?
> 
> Is it valid ?

It should be (and was in fact my original proposal). Just give it a shot.

Caution: Double underscore in the name: ${__threadNum}, not ${_threadNum}.

Cheers,
Felix

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


Re: JMeter: 10 Users using HTTP Request sending different files with POST method

Posted by Aleksandar Stoisavljevic <st...@gmail.com>.
Thanks Frank,

I see from documentation that this variable (_threadNum) won't me any good
in CSV Dataset config. If I understood correctly ?

I was wondering if I can use that variable directly in definition of file
path ?

e.g. in HTTP Request sampler when I am defining wich file should be used and
to have something like

/home/astoisavljevic/jmeter-test/msg_${_threadNum}.xml ?

Is it valid ?




On Fri, Sep 3, 2010 at 12:00 PM, Felix Frank <ff...@mpexnet.de> wrote:

> Hi,
>
> the threadNum function will be of help to you:
> http://jakarta.apache.org/jmeter/usermanual/functions.html#__threadNum
>
> You will probably want to use something like msg_no${__threadNum}.xml
> for your file name.
>
> HTH,
> Felix
>
> On 09/03/10 11:48, Aleksandar Stoisavljevic wrote:
> > Hi all,
> >
> > I was wondering if someone can help me in building following UseCase
> > scenario:
> >
> > I want to have 10 HTTP requests (simulating 10 users) that is trying to
> send
> > 10 different XML files using HTTP POST method.
> >
> > I want to stress test application, reaching peak of 10 users using web
> > application at one time.
> >
> >
> > To give you more info where I am stucked, see following what I have done
> > until now:
> >
> > 1. I have created one 'Thread Group' and entered Number of Threads
> (users) :
> > 10, Ramp-Up Period: 0 (I want to send all messages at once)
> >
> > 2. All requests will be sent to same server, same servlet so I have added
> > 'HTTP Request Defaults'. I filled up fields: 'Server name', 'Port' and
> > 'Path'. That won't change.
> >
> > 3. Then I have added Recording Controller and added one HTTP Request
> > Sampler. I've set the Method 'POST'. Now we are comming to the point.
> > At the bottom of HTTP Request screen there is option to add 'Sending
> files
> > with Request:'. But for different Users this file will be different. e.g
> > on file system I prepared those files msg_no1.xml, msg_no2.xml, .etc
> > Is it possible to assign different files to different threads ?
> >
> > any help would be appreciated
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>


-- 
Aleksandar dipl. ing. Stoisavljevic
Software Developer
mobile: +381 (0) 64 211 50 40
Web: http://www.staleksit.in.rs
E-mail:staleks@gmail.com <E-...@gmail.com>
SkypeId: staleks_ns
Mail: Branislava Nusica 10, 21000 Novi Sad, Serbia

Re: JMeter: 10 Users using HTTP Request sending different files with POST method

Posted by Felix Frank <ff...@mpexnet.de>.
Hi,

the threadNum function will be of help to you:
http://jakarta.apache.org/jmeter/usermanual/functions.html#__threadNum

You will probably want to use something like msg_no${__threadNum}.xml
for your file name.

HTH,
Felix

On 09/03/10 11:48, Aleksandar Stoisavljevic wrote:
> Hi all,
> 
> I was wondering if someone can help me in building following UseCase
> scenario:
> 
> I want to have 10 HTTP requests (simulating 10 users) that is trying to send
> 10 different XML files using HTTP POST method.
> 
> I want to stress test application, reaching peak of 10 users using web
> application at one time.
> 
> 
> To give you more info where I am stucked, see following what I have done
> until now:
> 
> 1. I have created one 'Thread Group' and entered Number of Threads (users) :
> 10, Ramp-Up Period: 0 (I want to send all messages at once)
> 
> 2. All requests will be sent to same server, same servlet so I have added
> 'HTTP Request Defaults'. I filled up fields: 'Server name', 'Port' and
> 'Path'. That won't change.
> 
> 3. Then I have added Recording Controller and added one HTTP Request
> Sampler. I've set the Method 'POST'. Now we are comming to the point.
> At the bottom of HTTP Request screen there is option to add 'Sending files
> with Request:'. But for different Users this file will be different. e.g
> on file system I prepared those files msg_no1.xml, msg_no2.xml, .etc
> Is it possible to assign different files to different threads ?
> 
> any help would be appreciated

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