You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Prakash <pk...@gmail.com> on 2010/06/04 20:25:54 UTC

How to capture dynamic values from HTTP Header Manager

Hi All,

Can someone help me what would be the solution for following scenario?

There are two responses get generated (say X.aspx and Y.aspx) upon a 
request.

The value of the <Location> parameter in the HTTP Header Manager of X.aspx
(POST Method used)contains the URL: Y.aspx?ID=abcdf

Y.aspx contains the send parameter that is <ID>

Jmeter does not capture the value of the Location parameter in the HTTP Header 
Managet of X.aspx during the recording(I found the header details of X.aspx 
contains the <Location> parameter using Fiddler).

How can I set the dynamic values generated by the system for the <Location> 
parameter in the HTTP Header Manager and would capture the value of variable
(ID) using regular expression from the header of X.aspx and assign it in the 
send parameters of Y.aspx?

Any help to get the solution will be appreciated.

Thanks,
Prakash




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


Re: How to capture dynamic values from HTTP Header Manager

Posted by Deepak Shetty <sh...@gmail.com>.
In most cases, When Jmeter  gives a different result to the browser, the
problem lies in the script - possibly there is some failure in the app due
to which it does not respond back correctly.

You must compare every preceding request/response with every corresponding
request/response from a browser tool like fiddler - both the names of the
parameters and their values. For parameters which are dynamic, you have to
check your Jmeter scripts to see that you have extracted the value
correctly(usually by looking at the text view in view response tab and
comparing the value there with the value the script posted in the next step)
. You can do this faster if you have some idea of the application and access
to its logs to quickly identify why the application fails . Note that
usually it is the current request or the previous request that is in error ,
but in theory any of the preceding requests can be problematic. As always
have good assertions while coding your scripts.

regards
deepak



On Mon, Jun 7, 2010 at 1:20 PM, Prakash <pk...@gmail.com> wrote:

> Samll Correction:
>
> I have still tried to add the header parameters in the request header of
> the
> sript that I am executing thru Jmeter as same as those are present while
> runing thru Fidler.But the dynamic variable (ID) does not appear in the
> View
> Results Tree Listener.
>
> Thanks,
> Prakash
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: How to capture dynamic values from HTTP Header Manager

Posted by Prakash <pk...@gmail.com>.
Samll Correction:

I have still tried to add the header parameters in the request header of the 
sript that I am executing thru Jmeter as same as those are present while 
runing thru Fidler.But the dynamic variable (ID) does not appear in the View 
Results Tree Listener.

Thanks,
Prakash



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


Re: How to capture dynamic values from HTTP Header Manager

Posted by Prakash <pk...@gmail.com>.
sebb <sebbaz <at> gmail.com> writes:

> 
> On 07/06/2010, Prakash <pkpalai <at> gmail.com> wrote:
> > Hi,
> >
> >  That is correct the Location header is sent by the server. But it is not
> >  being captured by Jmeter.
> 
> What do you mean by "captured" ?
> 
> Does it not appear in the View Results Tree Listener?
> All headers are shown on the Sampler Result tab under "Response Headers"
> 
> If if does not appear, maybe you have selected "Redirect automatically".
> 
> >  If I run thru the same action using Fidler, I can
> >  see the Location Header.
> >
> >  Any other options to make the Jmeter to receive the Location Header in 
this
> >  context?
> >
> >
> >  Thanks,
> >  Prakash
> >
> >
> >
> >
> >
> >
> >  ---------------------------------------------------------------------
> >  To unsubscribe, e-mail: jmeter-user-unsubscribe <at> jakarta.apache.org
> >  For additional commands, e-mail: jmeter-user-help <at> jakarta.apache.org
> >
> >
> 

Hi,


All the parameters those are present in response header while runing thru 
Fidler are all of them not present in the Response header(especially Location 
Parameter)while runing thru jmeter upon a specific request(the specific action 
in the application where I am facing this problem).


The response for dynamic value(ID) is not appear in the View Results Tree 
Listener.

The option "Redirect automatically" is not selected also.

I have still tried to add the header parameters in the response header of the 
sript that I am executing thru Jmeter as same as those are present while 
runing thru Fidler.But the dynamic variable (ID) does not appear in the View 
Results Tree Listener.

Thanks,
Prakash






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


Re: How to capture dynamic values from HTTP Header Manager

Posted by sebb <se...@gmail.com>.
On 07/06/2010, Prakash <pk...@gmail.com> wrote:
> Hi,
>
>  That is correct the Location header is sent by the server. But it is not
>  being captured by Jmeter.

What do you mean by "captured" ?

Does it not appear in the View Results Tree Listener?
All headers are shown on the Sampler Result tab under "Response Headers"

If if does not appear, maybe you have selected "Redirect automatically".

>  If I run thru the same action using Fidler, I can
>  see the Location Header.
>
>  Any other options to make the Jmeter to receive the Location Header in this
>  context?
>
>
>  Thanks,
>  Prakash
>
>
>
>
>
>
>  ---------------------------------------------------------------------
>  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: How to capture dynamic values from HTTP Header Manager

Posted by Prakash <pk...@gmail.com>.
Hi,

That is correct the Location header is sent by the server. But it is not 
being captured by Jmeter. If I run thru the same action using Fidler, I can 
see the Location Header.

Any other options to make the Jmeter to receive the Location Header in this 
context?

Thanks,
Prakash






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


Re: How to capture dynamic values from HTTP Header Manager

Posted by sebb <se...@gmail.com>.
On 04/06/2010, Prakash <pk...@gmail.com> wrote:
> sebb <sebbaz <at> gmail.com> writes:
>
>  >
>  > On 04/06/2010, Prakash <pkpalai <at> gmail.com> wrote:
>  > >
>  > >  sebb <sebbaz <at> gmail.com> writes:
>  > >
>  > >
>  > >  >
>  > >  > On 04/06/2010, Prakash <pkpalai <at> gmail.com> wrote:
>  > >  > > Hi All,
>  > >  > >
>  > >  > >  Can someone help me what would be the solution for following
>  scenario?
>  > >  > >
>  > >  > >  There are two responses get generated (say X.aspx and Y.aspx) upon a
>  > >  > >  request.
>  > >  > >
>  > >  > >  The value of the <Location> parameter in the HTTP Header Manager of
>  X.aspx
>  > >  > >  (POST Method used)contains the URL: Y.aspx?ID=abcdf
>  > >  > >
>  > >  > >  Y.aspx contains the send parameter that is <ID>
>  > >  > >
>  > >  > >  Jmeter does not capture the value of the Location parameter in the
>  HTTP
>  > >  Header
>  > >  >
>  > >  > JMeter captures all headers that it receives; check the response in
>  > >  > View Results Tree Listener.
>  > >  >
>  > >  > >  Managet of X.aspx during the recording(I found the header details of
>  > >  X.aspx
>  > >  > >  contains the <Location> parameter using Fiddler).
>  > >  > >
>  > >  > >  How can I set the dynamic values generated by the system for the
>  > >  <Location>
>  > >  > >  parameter in the HTTP Header Manager and would capture the value of
>  > >  variable
>  > >  > >  (ID) using regular expression from the header of X.aspx and assign
>  it in
>  > >  the
>  > >  > >  send parameters of Y.aspx?
>  > >  >
>  > >  > Why not use follow redirect?
>  > >  >
>  > >  > >  Any help to get the solution will be appreciated.
>  > >  > >
>  > >  > >  Thanks,
>  > >  > >  Prakash
>  > >  > >
>  > >  > >
>  > >  > >
>  > >  > >
>  > >  > >  ---------------------------------------------------------------------
>  > >
>  > > > >  To unsubscribe, e-mail: jmeter-user-unsubscribe <at>
>  jakarta.apache.org
>  > >  > >  For additional commands, e-mail: jmeter-user-help <at>
>  jakarta.apache.org
>  > >  > >
>  > >  > >
>  > >  >
>  > >
>  > >  Hi,
>  > >
>  > >  Ofcourse, JMeter captures header details that it receives. But in this
>  > >  specific context, it does not capture the value of <Location> parameter
>  which
>  > >  contains the dynamically generated URL that needs to be redirected..
>  > >
>  > >  I am using Follow Redirects but how to capture the value of the send
>  parameter
>  > >  (that is <Location>) for Y.aspx that supposed to be present in the HTTP
>  Header
>  > >  Manager of X.aspx?
>  >
>  > What has the Header Manager got to do with this?
>  > The Header Manager is used to send additional headers.
>  >
>  > The normal way to capture page content is to use:
>  >
>  >
>  http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Regular_Ex
>  pression_Extractor
>  >
>  > >
>  > >
>  > >  Thanks,
>  > >  Prakash
>  > >
>  > >
>  > >
>  > >
>  > >  ---------------------------------------------------------------------
>  > >  To unsubscribe, e-mail: jmeter-user-unsubscribe <at> jakarta.apache.org
>  > >  For additional commands, e-mail: jmeter-user-help <at> jakarta.apache.org
>  > >
>  > >
>  >
>
>  Hi,
>
>
> Let me explain you the exact context again:
>
>  Steps:
>  Suppose on specific action:
>  There are two response files on following sequence:
>
>  1. X.aspx
>  2. Y.aspx
>
>  HTTP-Header Manager of X.aspx contains following values:
>
>  Accept-Language:        en-us
>  Accept: */*
>  User-Agent:            Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; etc.)
>  Accept-Encoding:       gzip, deflate
>  UA-CPU:                x86
>
>  Location: <Dynamically generated URL-> //Y.aspx?ID=abcdf> which I can see when
>  run thru fiddler but does find from the response header of X.aspx while run
>  thru the Jmeter.

The HTTP Header Manager is used to add certain headers to the requests
sent by JMeter.

It does not make sense to send a Location header *to* the server; the
Location header is sent *by* the server.

>  The response content of X.aspx does not contain the value of the dynamic
>  variable <ID>.
>  Value of the <ID> is only present in the HTTP Header of X.aspx.
>
>  To work redirect correctly for Y.aspx, I need to have the value of the ID that
>  can be appended in the Y.aspx or <ID> can be  used as the send parameter for
>  Y.aspx.

If the Location: header is correctly set by the server, then JMeter
will follow it if you enable following.

Regarding extracting the ID from a response - did you read:

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

Also have a look at:

http://wiki.apache.org/jakarta-jmeter/DifferentBehaviour

>
>  Thanks,
>  Prakash
>
>
>
>
>
>
>
>
>  ---------------------------------------------------------------------
>  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: How to capture dynamic values from HTTP Header Manager

Posted by Prakash <pk...@gmail.com>.
sebb <sebbaz <at> gmail.com> writes:

> 
> On 04/06/2010, Prakash <pkpalai <at> gmail.com> wrote:
> >
> >  sebb <sebbaz <at> gmail.com> writes:
> >
> >
> >  >
> >  > On 04/06/2010, Prakash <pkpalai <at> gmail.com> wrote:
> >  > > Hi All,
> >  > >
> >  > >  Can someone help me what would be the solution for following 
scenario?
> >  > >
> >  > >  There are two responses get generated (say X.aspx and Y.aspx) upon a
> >  > >  request.
> >  > >
> >  > >  The value of the <Location> parameter in the HTTP Header Manager of 
X.aspx
> >  > >  (POST Method used)contains the URL: Y.aspx?ID=abcdf
> >  > >
> >  > >  Y.aspx contains the send parameter that is <ID>
> >  > >
> >  > >  Jmeter does not capture the value of the Location parameter in the 
HTTP
> >  Header
> >  >
> >  > JMeter captures all headers that it receives; check the response in
> >  > View Results Tree Listener.
> >  >
> >  > >  Managet of X.aspx during the recording(I found the header details of
> >  X.aspx
> >  > >  contains the <Location> parameter using Fiddler).
> >  > >
> >  > >  How can I set the dynamic values generated by the system for the
> >  <Location>
> >  > >  parameter in the HTTP Header Manager and would capture the value of
> >  variable
> >  > >  (ID) using regular expression from the header of X.aspx and assign 
it in
> >  the
> >  > >  send parameters of Y.aspx?
> >  >
> >  > Why not use follow redirect?
> >  >
> >  > >  Any help to get the solution will be appreciated.
> >  > >
> >  > >  Thanks,
> >  > >  Prakash
> >  > >
> >  > >
> >  > >
> >  > >
> >  > >  ---------------------------------------------------------------------
> >
> > > >  To unsubscribe, e-mail: jmeter-user-unsubscribe <at> 
jakarta.apache.org
> >  > >  For additional commands, e-mail: jmeter-user-help <at> 
jakarta.apache.org
> >  > >
> >  > >
> >  >
> >
> >  Hi,
> >
> >  Ofcourse, JMeter captures header details that it receives. But in this
> >  specific context, it does not capture the value of <Location> parameter 
which
> >  contains the dynamically generated URL that needs to be redirected..
> >
> >  I am using Follow Redirects but how to capture the value of the send 
parameter
> >  (that is <Location>) for Y.aspx that supposed to be present in the HTTP 
Header
> >  Manager of X.aspx?
> 
> What has the Header Manager got to do with this?
> The Header Manager is used to send additional headers.
> 
> The normal way to capture page content is to use:
> 
> 
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Regular_Ex
pression_Extractor
> 
> >
> >
> >  Thanks,
> >  Prakash
> >
> >
> >
> >
> >  ---------------------------------------------------------------------
> >  To unsubscribe, e-mail: jmeter-user-unsubscribe <at> jakarta.apache.org
> >  For additional commands, e-mail: jmeter-user-help <at> jakarta.apache.org
> >
> >
> 

Hi,

Let me explain you the exact context again:

Steps:
Suppose on specific action:
There are two response files on following sequence:

1. X.aspx
2. Y.aspx


HTTP-Header Manager of X.aspx contains following values:

Accept-Language:	en-us
Accept:	*/*
User-Agent:	       Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; etc.)
Accept-Encoding:       gzip, deflate
UA-CPU:	               x86

Location: <Dynamically generated URL-> //Y.aspx?ID=abcdf> which I can see when 
run thru fiddler but does find from the response header of X.aspx while run 
thru the Jmeter.

The response content of X.aspx does not contain the value of the dynamic 
variable <ID>. 
Value of the <ID> is only present in the HTTP Header of X.aspx.

To work redirect correctly for Y.aspx, I need to have the value of the ID that 
can be appended in the Y.aspx or <ID> can be  used as the send parameter for 
Y.aspx.


Thanks,
Prakash








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


Re: How to capture dynamic values from HTTP Header Manager

Posted by sebb <se...@gmail.com>.
On 04/06/2010, Prakash <pk...@gmail.com> wrote:
>
>  sebb <sebbaz <at> gmail.com> writes:
>
>
>  >
>  > On 04/06/2010, Prakash <pkpalai <at> gmail.com> wrote:
>  > > Hi All,
>  > >
>  > >  Can someone help me what would be the solution for following scenario?
>  > >
>  > >  There are two responses get generated (say X.aspx and Y.aspx) upon a
>  > >  request.
>  > >
>  > >  The value of the <Location> parameter in the HTTP Header Manager of X.aspx
>  > >  (POST Method used)contains the URL: Y.aspx?ID=abcdf
>  > >
>  > >  Y.aspx contains the send parameter that is <ID>
>  > >
>  > >  Jmeter does not capture the value of the Location parameter in the HTTP
>  Header
>  >
>  > JMeter captures all headers that it receives; check the response in
>  > View Results Tree Listener.
>  >
>  > >  Managet of X.aspx during the recording(I found the header details of
>  X.aspx
>  > >  contains the <Location> parameter using Fiddler).
>  > >
>  > >  How can I set the dynamic values generated by the system for the
>  <Location>
>  > >  parameter in the HTTP Header Manager and would capture the value of
>  variable
>  > >  (ID) using regular expression from the header of X.aspx and assign it in
>  the
>  > >  send parameters of Y.aspx?
>  >
>  > Why not use follow redirect?
>  >
>  > >  Any help to get the solution will be appreciated.
>  > >
>  > >  Thanks,
>  > >  Prakash
>  > >
>  > >
>  > >
>  > >
>  > >  ---------------------------------------------------------------------
>
> > >  To unsubscribe, e-mail: jmeter-user-unsubscribe <at> jakarta.apache.org
>  > >  For additional commands, e-mail: jmeter-user-help <at> jakarta.apache.org
>  > >
>  > >
>  >
>
>  Hi,
>
>  Ofcourse, JMeter captures header details that it receives. But in this
>  specific context, it does not capture the value of <Location> parameter which
>  contains the dynamically generated URL that needs to be redirected..
>
>  I am using Follow Redirects but how to capture the value of the send parameter
>  (that is <Location>) for Y.aspx that supposed to be present in the HTTP Header
>  Manager of X.aspx?

What has the Header Manager got to do with this?
The Header Manager is used to send additional headers.

The normal way to capture page content is to use:

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

>
>
>  Thanks,
>  Prakash
>
>
>
>
>  ---------------------------------------------------------------------
>  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: How to capture dynamic values from HTTP Header Manager

Posted by Prakash <pk...@gmail.com>.
sebb <sebbaz <at> gmail.com> writes:

> 
> On 04/06/2010, Prakash <pkpalai <at> gmail.com> wrote:
> > Hi All,
> >
> >  Can someone help me what would be the solution for following scenario?
> >
> >  There are two responses get generated (say X.aspx and Y.aspx) upon a
> >  request.
> >
> >  The value of the <Location> parameter in the HTTP Header Manager of X.aspx
> >  (POST Method used)contains the URL: Y.aspx?ID=abcdf
> >
> >  Y.aspx contains the send parameter that is <ID>
> >
> >  Jmeter does not capture the value of the Location parameter in the HTTP 
Header
> 
> JMeter captures all headers that it receives; check the response in
> View Results Tree Listener.
> 
> >  Managet of X.aspx during the recording(I found the header details of 
X.aspx
> >  contains the <Location> parameter using Fiddler).
> >
> >  How can I set the dynamic values generated by the system for the 
<Location>
> >  parameter in the HTTP Header Manager and would capture the value of 
variable
> >  (ID) using regular expression from the header of X.aspx and assign it in 
the
> >  send parameters of Y.aspx?
> 
> Why not use follow redirect?
> 
> >  Any help to get the solution will be appreciated.
> >
> >  Thanks,
> >  Prakash
> >
> >
> >
> >
> >  ---------------------------------------------------------------------
> >  To unsubscribe, e-mail: jmeter-user-unsubscribe <at> jakarta.apache.org
> >  For additional commands, e-mail: jmeter-user-help <at> jakarta.apache.org
> >
> >
>

Hi,

Ofcourse, JMeter captures header details that it receives. But in this 
specific context, it does not capture the value of <Location> parameter which 
contains the dynamically generated URL that needs to be redirected..

I am using Follow Redirects but how to capture the value of the send parameter 
(that is <Location>) for Y.aspx that supposed to be present in the HTTP Header 
Manager of X.aspx?


Thanks,
Prakash 




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


Re: How to capture dynamic values from HTTP Header Manager

Posted by sebb <se...@gmail.com>.
On 04/06/2010, Prakash <pk...@gmail.com> wrote:
> Hi All,
>
>  Can someone help me what would be the solution for following scenario?
>
>  There are two responses get generated (say X.aspx and Y.aspx) upon a
>  request.
>
>  The value of the <Location> parameter in the HTTP Header Manager of X.aspx
>  (POST Method used)contains the URL: Y.aspx?ID=abcdf
>
>  Y.aspx contains the send parameter that is <ID>
>
>  Jmeter does not capture the value of the Location parameter in the HTTP Header

JMeter captures all headers that it receives; check the response in
View Results Tree Listener.

>  Managet of X.aspx during the recording(I found the header details of X.aspx
>  contains the <Location> parameter using Fiddler).
>
>  How can I set the dynamic values generated by the system for the <Location>
>  parameter in the HTTP Header Manager and would capture the value of variable
>  (ID) using regular expression from the header of X.aspx and assign it in the
>  send parameters of Y.aspx?

Why not use follow redirect?

>  Any help to get the solution will be appreciated.
>
>  Thanks,
>  Prakash
>
>
>
>
>  ---------------------------------------------------------------------
>  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