You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Paul Rogers <pm...@gmail.com> on 2008/02/06 23:51:07 UTC

grouping requests and getting reuse

I looked through the manual, but couldnt see a solution to this.

Id like to be able to group requests so I can reuse them, so instead of
having 20 get requests to images, I have a single item that will in turn
call those 20 gets.


so something like this, as a sort of pseudo test plan




gropup --IMAGES--
    get /images/logo.gif
    get /banner.gif
ThreadGrouop
    get --IMAGES--
    get /some/path/login.jsp
    post /some/path/login.jsp
    get --IMAGES--
    get /some/other/page




and possibly even better would be to be able to store the --IMAGES-- in a
different file, so I can reuse it betwen scripts.


Any ideas greatly appreciated.

Paul

Re: grouping requests and getting reuse

Posted by sebb <se...@gmail.com>.
On 07/02/2008, Paul Rogers <pa...@shaw.ca> wrote:
> thanks, worked perfectly. Sorry for the double post, Im having some gmail
> problems.
>
> I now have another issue, which I expect is just due to my misunderstanding
> of jmener.
>

In future, please start a new thread for a new question, as it makes
it easier to follow the thread.

> Im trying to request some images.
>
> The first time through should cause all the images to get downloaded,
>
> On the last image, I  use a reg exp to get the last-modified-date from the
> response header, and use this as the value for the If-modified-since request
> header on subsequent requests
>
> The intention is that this is what a browser would do - download an image
> the first time it encounters it, and then subsequently request the image,
> but get back a 304 as the image hasnt changed
>
>
> my test plan is like this
>
> user defined variable set_initial_modified header - this sets a variable to
> a date that will cause the server to send the image
> images
>    header-manager
>    get /image/logo.gif
>    get /another/image2.gif
>
> Thread Group
>   get /some/page
>   get images
>   reg-exp extractor to reset the variable to the last-modified-date from the
> header
>   get /another/page
>   get /images
>
>
>
> Ive moved the reg-exp around, but it always seems to get executed after the
> first  request for logo.gif , rather than after image2.gif, which means all
> my images apart from the first one have 304 responses. Do I need to do
> something special to ensure it gets executed after the first request to
> image2 ?

Post Processors are applied to all samplers in their scope, so just
add it as a child of the request to which you want it applied.
> Many thanks
>
> Paul
>
>
>
> On 2/6/08, sebb <se...@gmail.com> wrote:
> >
> > Have you tried the Module Controller:
> >
> >
> > http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Module_Controller
> >
> >
> > On 06/02/2008, Paul Rogers <pm...@gmail.com> wrote:
> > > I looked through the manual, but couldnt see a solution to this.
> > >
> > > Id like to be able to group requests so I can reuse them, so instead of
> > > having 20 get requests to images, I have a single item that will in turn
> > > call those 20 gets.
> > >
> > >
> > > so something like this, as a sort of pseudo test plan
> > >
> > >
> > >
> > >
> > > gropup --IMAGES--
> > >     get /images/logo.gif
> > >     get /banner.gif
> > > ThreadGrouop
> > >     get --IMAGES--
> > >     get /some/path/login.jsp
> > >     post /some/path/login.jsp
> > >     get --IMAGES--
> > >     get /some/other/page
> > >
> > >
> > >
> > >
> > > and possibly even better would be to be able to store the --IMAGES-- in
> > a
> > > different file, so I can reuse it betwen scripts.
> > >
> > >
> > > Any ideas greatly appreciated.
> > >
> > > Paul
> > >
> >
> > ---------------------------------------------------------------------
> > 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


Re: grouping requests and getting reuse

Posted by Paul Rogers <pa...@shaw.ca>.
thanks, worked perfectly. Sorry for the double post, Im having some gmail
problems.

I now have another issue, which I expect is just due to my misunderstanding
of jmener.

Im trying to request some images.

The first time through should cause all the images to get downloaded,

On the last image, I  use a reg exp to get the last-modified-date from the
response header, and use this as the value for the If-modified-since request
header on subsequent requests

The intention is that this is what a browser would do - download an image
the first time it encounters it, and then subsequently request the image,
but get back a 304 as the image hasnt changed


my test plan is like this

user defined variable set_initial_modified header - this sets a variable to
a date that will cause the server to send the image
images
   header-manager
   get /image/logo.gif
   get /another/image2.gif

Thread Group
  get /some/page
  get images
  reg-exp extractor to reset the variable to the last-modified-date from the
header
  get /another/page
  get /images



Ive moved the reg-exp around, but it always seems to get executed after the
first  request for logo.gif , rather than after image2.gif, which means all
my images apart from the first one have 304 responses. Do I need to do
something special to ensure it gets executed after the first request to
image2 ?

Many thanks

Paul



On 2/6/08, sebb <se...@gmail.com> wrote:
>
> Have you tried the Module Controller:
>
>
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Module_Controller
>
>
> On 06/02/2008, Paul Rogers <pm...@gmail.com> wrote:
> > I looked through the manual, but couldnt see a solution to this.
> >
> > Id like to be able to group requests so I can reuse them, so instead of
> > having 20 get requests to images, I have a single item that will in turn
> > call those 20 gets.
> >
> >
> > so something like this, as a sort of pseudo test plan
> >
> >
> >
> >
> > gropup --IMAGES--
> >     get /images/logo.gif
> >     get /banner.gif
> > ThreadGrouop
> >     get --IMAGES--
> >     get /some/path/login.jsp
> >     post /some/path/login.jsp
> >     get --IMAGES--
> >     get /some/other/page
> >
> >
> >
> >
> > and possibly even better would be to be able to store the --IMAGES-- in
> a
> > different file, so I can reuse it betwen scripts.
> >
> >
> > Any ideas greatly appreciated.
> >
> > Paul
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: grouping requests and getting reuse

Posted by sebb <se...@gmail.com>.
Have you tried the Module Controller:

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Module_Controller


On 06/02/2008, Paul Rogers <pm...@gmail.com> wrote:
> I looked through the manual, but couldnt see a solution to this.
>
> Id like to be able to group requests so I can reuse them, so instead of
> having 20 get requests to images, I have a single item that will in turn
> call those 20 gets.
>
>
> so something like this, as a sort of pseudo test plan
>
>
>
>
> gropup --IMAGES--
>     get /images/logo.gif
>     get /banner.gif
> ThreadGrouop
>     get --IMAGES--
>     get /some/path/login.jsp
>     post /some/path/login.jsp
>     get --IMAGES--
>     get /some/other/page
>
>
>
>
> and possibly even better would be to be able to store the --IMAGES-- in a
> different file, so I can reuse it betwen scripts.
>
>
> Any ideas greatly appreciated.
>
> Paul
>

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