You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Marcelo Jara <ma...@hotmail.com> on 2012/04/23 22:13:53 UTC

Conditional redirection

Hello,

The web application I'm testing will sometimes redirect requests to another page that live on the same server and sometimes it redirects to pages that live on a different server. I want Jmeter to follow redirects to local pages only.

Example:

http://test.server.one/home
redirects to 
http://test.server.one/welcome

This is ok. 

http://test.server.on/account
redirects to
http://test.server.two/info

I don't want jmeter to redirect in this case. 

What can I use to achieve this?


Thanks,

MJ
 		 	   		  

Proxy recorder and headers

Posted by ll...@oreillyauto.com.
When using the proxy recorder, is there a way to make it only include
headers that are different or not included in a HTTP Header Manager placed
as a child of the Recording Controller?

It's not a huge deal, but it's a bit of a hassle with how I want my tests
laid out.

Thank you.

Lee Lowder

This communication and any attachments are confidential, protected by Communications Privacy Act 18 USCS � 2510, solely for the use of the intended recipient, and may contain legally privileged material. If you are not the intended recipient, please return or destroy it immediately. Thank you.

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


Re: Conditional redirection

Posted by Flavio Cysne <fl...@gmail.com>.
I think you'll need no loops if, on the second sampler, you have "Follow
Redirections" checked. Isn't it?

Hope it helps you.
Flavio Cysne

2012/4/24 Marcelo Jara <ma...@hotmail.com>

>
> Makes sense. thanks.
>
> > Date: Mon, 23 Apr 2012 15:05:57 -0700
> > Subject: Re: Conditional redirection
> > From: bhatt.chaitanya@gmail.com
> > To: user@jmeter.apache.org
> >
> > Marcelo,
> >
> > Adding to what Deepak mentioned, you will also have to include a LOOP to
> > make sure that the tool keeps following the 'Location' as long as the
> > server returns http codes such as 300, 302 etc. This will ensure that
> your
> > scripts follows consecutive redirections which is a common phenomena
> > in production systems.
> >
> > Thanks
> > Chaitanya M Bhatt
> > http://www.performancecompetence.com
> >
> > On Mon, Apr 23, 2012 at 1:44 PM, Marcelo Jara <marcelojara@hotmail.com
> >wrote:
> >
> > >
> > > ok thanks. I'll give it a try. It would have been nice to be able to
> use a
> > > regular expression for the redirection similar to the embedded
> resources.
> > >
> > > > Date: Mon, 23 Apr 2012 13:18:10 -0700
> > > > Subject: Re: Conditional redirection
> > > > From: shettyd@gmail.com
> > > > To: user@jmeter.apache.org
> > >  >
> > > > Pseudo
> > > > +HTTP sampler (Uncheck follow redirects and redirect automatically
> on the
> > > > sampler)
> > > > ++ regex post processor(targetting headers) extract Location header
> value
> > > > ++ regex post processor status code
> > > > +if controller - the status code begins with 3xx and the location
> header
> > > > matches your criteria
> > > > ++HTTP sampler (${extractedURL})
> > > >
> > > >
> > > > regards
> > > > deepak
> > > >
> > > > On Mon, Apr 23, 2012 at 1:13 PM, Marcelo Jara <
> marcelojara@hotmail.com
> > > >wrote:
> > > >
> > > > >
> > > > > Hello,
> > > > >
> > > > > The web application I'm testing will sometimes redirect requests to
> > > > > another page that live on the same server and sometimes it
> redirects to
> > > > > pages that live on a different server. I want Jmeter to follow
> > > redirects to
> > > > > local pages only.
> > > > >
> > > > > Example:
> > > > >
> > > > > http://test.server.one/home
> > > > > redirects to
> > > > > http://test.server.one/welcome
> > > > >
> > > > > This is ok.
> > > > >
> > > > > http://test.server.on/account
> > > > > redirects to
> > > > > http://test.server.two/info
> > > > >
> > > > > I don't want jmeter to redirect in this case.
> > > > >
> > > > > What can I use to achieve this?
> > > > >
> > > > >
> > > > > Thanks,
> > > > >
> > > > > MJ
> > > > >
> > >
> > >
>
>

RE: Conditional redirection

Posted by Marcelo Jara <ma...@hotmail.com>.
Makes sense. thanks. 

> Date: Mon, 23 Apr 2012 15:05:57 -0700
> Subject: Re: Conditional redirection
> From: bhatt.chaitanya@gmail.com
> To: user@jmeter.apache.org
> 
> Marcelo,
> 
> Adding to what Deepak mentioned, you will also have to include a LOOP to
> make sure that the tool keeps following the 'Location' as long as the
> server returns http codes such as 300, 302 etc. This will ensure that your
> scripts follows consecutive redirections which is a common phenomena
> in production systems.
> 
> Thanks
> Chaitanya M Bhatt
> http://www.performancecompetence.com
> 
> On Mon, Apr 23, 2012 at 1:44 PM, Marcelo Jara <ma...@hotmail.com>wrote:
> 
> >
> > ok thanks. I'll give it a try. It would have been nice to be able to use a
> > regular expression for the redirection similar to the embedded resources.
> >
> > > Date: Mon, 23 Apr 2012 13:18:10 -0700
> > > Subject: Re: Conditional redirection
> > > From: shettyd@gmail.com
> > > To: user@jmeter.apache.org
> >  >
> > > Pseudo
> > > +HTTP sampler (Uncheck follow redirects and redirect automatically on the
> > > sampler)
> > > ++ regex post processor(targetting headers) extract Location header value
> > > ++ regex post processor status code
> > > +if controller - the status code begins with 3xx and the location header
> > > matches your criteria
> > > ++HTTP sampler (${extractedURL})
> > >
> > >
> > > regards
> > > deepak
> > >
> > > On Mon, Apr 23, 2012 at 1:13 PM, Marcelo Jara <marcelojara@hotmail.com
> > >wrote:
> > >
> > > >
> > > > Hello,
> > > >
> > > > The web application I'm testing will sometimes redirect requests to
> > > > another page that live on the same server and sometimes it redirects to
> > > > pages that live on a different server. I want Jmeter to follow
> > redirects to
> > > > local pages only.
> > > >
> > > > Example:
> > > >
> > > > http://test.server.one/home
> > > > redirects to
> > > > http://test.server.one/welcome
> > > >
> > > > This is ok.
> > > >
> > > > http://test.server.on/account
> > > > redirects to
> > > > http://test.server.two/info
> > > >
> > > > I don't want jmeter to redirect in this case.
> > > >
> > > > What can I use to achieve this?
> > > >
> > > >
> > > > Thanks,
> > > >
> > > > MJ
> > > >
> >
> >
 		 	   		  

Re: Conditional redirection

Posted by chaitanya bhatt <bh...@gmail.com>.
Marcelo,

Adding to what Deepak mentioned, you will also have to include a LOOP to
make sure that the tool keeps following the 'Location' as long as the
server returns http codes such as 300, 302 etc. This will ensure that your
scripts follows consecutive redirections which is a common phenomena
in production systems.

Thanks
Chaitanya M Bhatt
http://www.performancecompetence.com

On Mon, Apr 23, 2012 at 1:44 PM, Marcelo Jara <ma...@hotmail.com>wrote:

>
> ok thanks. I'll give it a try. It would have been nice to be able to use a
> regular expression for the redirection similar to the embedded resources.
>
> > Date: Mon, 23 Apr 2012 13:18:10 -0700
> > Subject: Re: Conditional redirection
> > From: shettyd@gmail.com
> > To: user@jmeter.apache.org
>  >
> > Pseudo
> > +HTTP sampler (Uncheck follow redirects and redirect automatically on the
> > sampler)
> > ++ regex post processor(targetting headers) extract Location header value
> > ++ regex post processor status code
> > +if controller - the status code begins with 3xx and the location header
> > matches your criteria
> > ++HTTP sampler (${extractedURL})
> >
> >
> > regards
> > deepak
> >
> > On Mon, Apr 23, 2012 at 1:13 PM, Marcelo Jara <marcelojara@hotmail.com
> >wrote:
> >
> > >
> > > Hello,
> > >
> > > The web application I'm testing will sometimes redirect requests to
> > > another page that live on the same server and sometimes it redirects to
> > > pages that live on a different server. I want Jmeter to follow
> redirects to
> > > local pages only.
> > >
> > > Example:
> > >
> > > http://test.server.one/home
> > > redirects to
> > > http://test.server.one/welcome
> > >
> > > This is ok.
> > >
> > > http://test.server.on/account
> > > redirects to
> > > http://test.server.two/info
> > >
> > > I don't want jmeter to redirect in this case.
> > >
> > > What can I use to achieve this?
> > >
> > >
> > > Thanks,
> > >
> > > MJ
> > >
>
>

RE: Conditional redirection

Posted by Marcelo Jara <ma...@hotmail.com>.
ok thanks. I'll give it a try. It would have been nice to be able to use a regular expression for the redirection similar to the embedded resources.

> Date: Mon, 23 Apr 2012 13:18:10 -0700
> Subject: Re: Conditional redirection
> From: shettyd@gmail.com
> To: user@jmeter.apache.org
> 
> Pseudo
> +HTTP sampler (Uncheck follow redirects and redirect automatically on the
> sampler)
> ++ regex post processor(targetting headers) extract Location header value
> ++ regex post processor status code
> +if controller - the status code begins with 3xx and the location header
> matches your criteria
> ++HTTP sampler (${extractedURL})
> 
> 
> regards
> deepak
> 
> On Mon, Apr 23, 2012 at 1:13 PM, Marcelo Jara <ma...@hotmail.com>wrote:
> 
> >
> > Hello,
> >
> > The web application I'm testing will sometimes redirect requests to
> > another page that live on the same server and sometimes it redirects to
> > pages that live on a different server. I want Jmeter to follow redirects to
> > local pages only.
> >
> > Example:
> >
> > http://test.server.one/home
> > redirects to
> > http://test.server.one/welcome
> >
> > This is ok.
> >
> > http://test.server.on/account
> > redirects to
> > http://test.server.two/info
> >
> > I don't want jmeter to redirect in this case.
> >
> > What can I use to achieve this?
> >
> >
> > Thanks,
> >
> > MJ
> >
 		 	   		  

Re: Conditional redirection

Posted by Deepak Shetty <sh...@gmail.com>.
Pseudo
+HTTP sampler (Uncheck follow redirects and redirect automatically on the
sampler)
++ regex post processor(targetting headers) extract Location header value
++ regex post processor status code
+if controller - the status code begins with 3xx and the location header
matches your criteria
++HTTP sampler (${extractedURL})


regards
deepak

On Mon, Apr 23, 2012 at 1:13 PM, Marcelo Jara <ma...@hotmail.com>wrote:

>
> Hello,
>
> The web application I'm testing will sometimes redirect requests to
> another page that live on the same server and sometimes it redirects to
> pages that live on a different server. I want Jmeter to follow redirects to
> local pages only.
>
> Example:
>
> http://test.server.one/home
> redirects to
> http://test.server.one/welcome
>
> This is ok.
>
> http://test.server.on/account
> redirects to
> http://test.server.two/info
>
> I don't want jmeter to redirect in this case.
>
> What can I use to achieve this?
>
>
> Thanks,
>
> MJ
>