You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Vikas Malik <vi...@shop2020.in> on 2011/03/25 07:11:14 UTC

jmeter to store responses in recording controller.

Hello,

I am using jmeter for functional testing the website. I am trying to store
the responses while recording the HTTP request traffic using HTTP proxy
server, but there does not seem to be any option in jmeter to store
responses.

Basically I am trying to do the following. Please let me know if it is
possible to do so using jmeter, if yes, any pointers how to go about it will
be very useful.

1. Store the http traffic(both request and response) using HTTP proxy. Store
the responses as samples.
2. Re-run the recorded HTTP requests in testing phase and compare the
responses we get now against the samples stored in step 1. Any mismatch
should fail the test.

Thanks.
Vikas Malik

Re: jmeter to store responses in recording controller.

Posted by sebb <se...@gmail.com>.
On 25 March 2011 12:33, Vikas Malik <vi...@shop2020.in> wrote:
>> Have you looked at the documentation, particularly the component
> reference?
>
> 1. Yes Sebb, I have seen "save response to file" and tried it. The thing is,
> we can not use it to store the response while we are manually playing
> through proxy and recording. Proxy should be able to capture response also
> at the same time instead of having to replay it again to create the samples.

That does work, but you have to put the Listeners on the Workbench
which is where the "sampler" - i.e. Proxy - is.

> If we create samples in next step while replaying we need to go to each
> response again to manually verify that sample to be sure that samples are
> good, nothing went wrong this time. I think second step is unnecessary.

It is.

> 2. The other question is, can jmeter compare responses from test run against
> a set of reference responses stored on disk and give a report saying which
> requests produced different results.

No, file comparison is not supported by JMeter.
You could always write your own Assertion using the BSF or BSH
Assertion elements.

Or you can use Assertions - e.g. MD5 - to check for such things.

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

You would have to work out the hashes beforehand and perhaps put them
in a CSV file.

>
> On Fri, Mar 25, 2011 at 5:36 PM, sebb <se...@gmail.com> wrote:
>
>> On 25 March 2011 07:32, Vikas Malik <vi...@shop2020.in> wrote:
>> > Hi David,
>> >
>> > Thanks for the response,
>> >
>> >>(1) Capture them all in a Results Tree sampler. I think I would do this
>> > twice for one and two as you list below, then compare the output files
>> >
>> > I have many requests(test cases) in my automated test suite. At the end
>> of
>> > test-run, I want to get a list of failed test cases/requests.
>> > In this case, I guess it would be needed to do some extra work "parse and
>> > compare" the two xmls etc.
>> >
>> > This requirement is a very general use case. Does jmeter provide a
>> simpler
>> > way to go about it?
>>
>> Have you looked at the documentation, particularly the component reference?
>>
>> There is a Listener (Save Results) that can do just this.
>>
>> > For load testing also, I think it would be useful because to verify that
>> > under a heavy load also your website sends expected response is
>> important.
>> >
>> > Please let me know if I am trying to do something differently or missing
>> > something.
>> >
>> > Thanks.
>> >
>> >
>> > On Fri, Mar 25, 2011 at 11:50 AM, David Patrick <da...@mac.com>
>> wrote:
>> >
>> >> Hi Vikas,
>> >>
>> >> To record the responses, I think you have two options:
>> >> (1) Capture them all in a Results Tree sampler. I think I would do this
>> >> twice for one and two as you list below, then compare the output files
>> >>
>> >> or
>> >>
>> >> (2) Use Badboy (badboy.com.au) to record the transactions in record
>> phase.
>> >> Then, after exporting this to a JMX file, you will be able to run it and
>> >> compare the results you get.
>> >>
>> >> If you are looking to do both your steps in each iteration, then I think
>> >> that extending my option (1) above is the way to go - possibly using
>> REGEX
>> >> samples, variables and assertions to capture the response, re-request it
>> and
>> >> check again.
>> >>
>> >> I hope I have been of help.
>> >>
>> >> --
>> >> David Patrick
>> >> david.m1fcf@mac.com
>> >>
>> >> On 25 Mar 2011, at 06:11, Vikas Malik wrote:
>> >>
>> >> > Hello,
>> >> >
>> >> > I am using jmeter for functional testing the website. I am trying to
>> >> store
>> >> > the responses while recording the HTTP request traffic using HTTP
>> proxy
>> >> > server, but there does not seem to be any option in jmeter to store
>> >> > responses.
>> >> >
>> >> > Basically I am trying to do the following. Please let me know if it is
>> >> > possible to do so using jmeter, if yes, any pointers how to go about
>> it
>> >> will
>> >> > be very useful.
>> >> >
>> >> > 1. Store the http traffic(both request and response) using HTTP proxy.
>> >> Store
>> >> > the responses as samples.
>> >> > 2. Re-run the recorded HTTP requests in testing phase and compare the
>> >> > responses we get now against the samples stored in step 1. Any
>> mismatch
>> >> > should fail the test.
>> >> >
>> >> > Thanks.
>> >> > Vikas Malik
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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
>>
>>
>

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


Re: jmeter to store responses in recording controller.

Posted by Vikas Malik <vi...@shop2020.in>.
> Have you looked at the documentation, particularly the component
reference?

1. Yes Sebb, I have seen "save response to file" and tried it. The thing is,
we can not use it to store the response while we are manually playing
through proxy and recording. Proxy should be able to capture response also
at the same time instead of having to replay it again to create the samples.
If we create samples in next step while replaying we need to go to each
response again to manually verify that sample to be sure that samples are
good, nothing went wrong this time. I think second step is unnecessary.

2. The other question is, can jmeter compare responses from test run against
a set of reference responses stored on disk and give a report saying which
requests produced different results.


On Fri, Mar 25, 2011 at 5:36 PM, sebb <se...@gmail.com> wrote:

> On 25 March 2011 07:32, Vikas Malik <vi...@shop2020.in> wrote:
> > Hi David,
> >
> > Thanks for the response,
> >
> >>(1) Capture them all in a Results Tree sampler. I think I would do this
> > twice for one and two as you list below, then compare the output files
> >
> > I have many requests(test cases) in my automated test suite. At the end
> of
> > test-run, I want to get a list of failed test cases/requests.
> > In this case, I guess it would be needed to do some extra work "parse and
> > compare" the two xmls etc.
> >
> > This requirement is a very general use case. Does jmeter provide a
> simpler
> > way to go about it?
>
> Have you looked at the documentation, particularly the component reference?
>
> There is a Listener (Save Results) that can do just this.
>
> > For load testing also, I think it would be useful because to verify that
> > under a heavy load also your website sends expected response is
> important.
> >
> > Please let me know if I am trying to do something differently or missing
> > something.
> >
> > Thanks.
> >
> >
> > On Fri, Mar 25, 2011 at 11:50 AM, David Patrick <da...@mac.com>
> wrote:
> >
> >> Hi Vikas,
> >>
> >> To record the responses, I think you have two options:
> >> (1) Capture them all in a Results Tree sampler. I think I would do this
> >> twice for one and two as you list below, then compare the output files
> >>
> >> or
> >>
> >> (2) Use Badboy (badboy.com.au) to record the transactions in record
> phase.
> >> Then, after exporting this to a JMX file, you will be able to run it and
> >> compare the results you get.
> >>
> >> If you are looking to do both your steps in each iteration, then I think
> >> that extending my option (1) above is the way to go - possibly using
> REGEX
> >> samples, variables and assertions to capture the response, re-request it
> and
> >> check again.
> >>
> >> I hope I have been of help.
> >>
> >> --
> >> David Patrick
> >> david.m1fcf@mac.com
> >>
> >> On 25 Mar 2011, at 06:11, Vikas Malik wrote:
> >>
> >> > Hello,
> >> >
> >> > I am using jmeter for functional testing the website. I am trying to
> >> store
> >> > the responses while recording the HTTP request traffic using HTTP
> proxy
> >> > server, but there does not seem to be any option in jmeter to store
> >> > responses.
> >> >
> >> > Basically I am trying to do the following. Please let me know if it is
> >> > possible to do so using jmeter, if yes, any pointers how to go about
> it
> >> will
> >> > be very useful.
> >> >
> >> > 1. Store the http traffic(both request and response) using HTTP proxy.
> >> Store
> >> > the responses as samples.
> >> > 2. Re-run the recorded HTTP requests in testing phase and compare the
> >> > responses we get now against the samples stored in step 1. Any
> mismatch
> >> > should fail the test.
> >> >
> >> > Thanks.
> >> > Vikas Malik
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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: jmeter to store responses in recording controller.

Posted by sebb <se...@gmail.com>.
On 25 March 2011 07:32, Vikas Malik <vi...@shop2020.in> wrote:
> Hi David,
>
> Thanks for the response,
>
>>(1) Capture them all in a Results Tree sampler. I think I would do this
> twice for one and two as you list below, then compare the output files
>
> I have many requests(test cases) in my automated test suite. At the end of
> test-run, I want to get a list of failed test cases/requests.
> In this case, I guess it would be needed to do some extra work "parse and
> compare" the two xmls etc.
>
> This requirement is a very general use case. Does jmeter provide a simpler
> way to go about it?

Have you looked at the documentation, particularly the component reference?

There is a Listener (Save Results) that can do just this.

> For load testing also, I think it would be useful because to verify that
> under a heavy load also your website sends expected response is important.
>
> Please let me know if I am trying to do something differently or missing
> something.
>
> Thanks.
>
>
> On Fri, Mar 25, 2011 at 11:50 AM, David Patrick <da...@mac.com> wrote:
>
>> Hi Vikas,
>>
>> To record the responses, I think you have two options:
>> (1) Capture them all in a Results Tree sampler. I think I would do this
>> twice for one and two as you list below, then compare the output files
>>
>> or
>>
>> (2) Use Badboy (badboy.com.au) to record the transactions in record phase.
>> Then, after exporting this to a JMX file, you will be able to run it and
>> compare the results you get.
>>
>> If you are looking to do both your steps in each iteration, then I think
>> that extending my option (1) above is the way to go - possibly using REGEX
>> samples, variables and assertions to capture the response, re-request it and
>> check again.
>>
>> I hope I have been of help.
>>
>> --
>> David Patrick
>> david.m1fcf@mac.com
>>
>> On 25 Mar 2011, at 06:11, Vikas Malik wrote:
>>
>> > Hello,
>> >
>> > I am using jmeter for functional testing the website. I am trying to
>> store
>> > the responses while recording the HTTP request traffic using HTTP proxy
>> > server, but there does not seem to be any option in jmeter to store
>> > responses.
>> >
>> > Basically I am trying to do the following. Please let me know if it is
>> > possible to do so using jmeter, if yes, any pointers how to go about it
>> will
>> > be very useful.
>> >
>> > 1. Store the http traffic(both request and response) using HTTP proxy.
>> Store
>> > the responses as samples.
>> > 2. Re-run the recorded HTTP requests in testing phase and compare the
>> > responses we get now against the samples stored in step 1. Any mismatch
>> > should fail the test.
>> >
>> > Thanks.
>> > Vikas Malik
>>
>>
>> ---------------------------------------------------------------------
>> 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: jmeter to store responses in recording controller.

Posted by Vikas Malik <vi...@shop2020.in>.
Hi David,

Thanks for the response,

>(1) Capture them all in a Results Tree sampler. I think I would do this
twice for one and two as you list below, then compare the output files

I have many requests(test cases) in my automated test suite. At the end of
test-run, I want to get a list of failed test cases/requests.
In this case, I guess it would be needed to do some extra work "parse and
compare" the two xmls etc.

This requirement is a very general use case. Does jmeter provide a simpler
way to go about it?

For load testing also, I think it would be useful because to verify that
under a heavy load also your website sends expected response is important.

Please let me know if I am trying to do something differently or missing
something.

Thanks.


On Fri, Mar 25, 2011 at 11:50 AM, David Patrick <da...@mac.com> wrote:

> Hi Vikas,
>
> To record the responses, I think you have two options:
> (1) Capture them all in a Results Tree sampler. I think I would do this
> twice for one and two as you list below, then compare the output files
>
> or
>
> (2) Use Badboy (badboy.com.au) to record the transactions in record phase.
> Then, after exporting this to a JMX file, you will be able to run it and
> compare the results you get.
>
> If you are looking to do both your steps in each iteration, then I think
> that extending my option (1) above is the way to go - possibly using REGEX
> samples, variables and assertions to capture the response, re-request it and
> check again.
>
> I hope I have been of help.
>
> --
> David Patrick
> david.m1fcf@mac.com
>
> On 25 Mar 2011, at 06:11, Vikas Malik wrote:
>
> > Hello,
> >
> > I am using jmeter for functional testing the website. I am trying to
> store
> > the responses while recording the HTTP request traffic using HTTP proxy
> > server, but there does not seem to be any option in jmeter to store
> > responses.
> >
> > Basically I am trying to do the following. Please let me know if it is
> > possible to do so using jmeter, if yes, any pointers how to go about it
> will
> > be very useful.
> >
> > 1. Store the http traffic(both request and response) using HTTP proxy.
> Store
> > the responses as samples.
> > 2. Re-run the recorded HTTP requests in testing phase and compare the
> > responses we get now against the samples stored in step 1. Any mismatch
> > should fail the test.
> >
> > Thanks.
> > Vikas Malik
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: jmeter to store responses in recording controller.

Posted by David Patrick <da...@mac.com>.
Hi Vikas,

To record the responses, I think you have two options:
(1) Capture them all in a Results Tree sampler. I think I would do this twice for one and two as you list below, then compare the output files

or

(2) Use Badboy (badboy.com.au) to record the transactions in record phase. Then, after exporting this to a JMX file, you will be able to run it and compare the results you get.

If you are looking to do both your steps in each iteration, then I think that extending my option (1) above is the way to go - possibly using REGEX samples, variables and assertions to capture the response, re-request it and check again.

I hope I have been of help.

-- 
David Patrick
david.m1fcf@mac.com

On 25 Mar 2011, at 06:11, Vikas Malik wrote:

> Hello,
> 
> I am using jmeter for functional testing the website. I am trying to store
> the responses while recording the HTTP request traffic using HTTP proxy
> server, but there does not seem to be any option in jmeter to store
> responses.
> 
> Basically I am trying to do the following. Please let me know if it is
> possible to do so using jmeter, if yes, any pointers how to go about it will
> be very useful.
> 
> 1. Store the http traffic(both request and response) using HTTP proxy. Store
> the responses as samples.
> 2. Re-run the recorded HTTP requests in testing phase and compare the
> responses we get now against the samples stored in step 1. Any mismatch
> should fail the test.
> 
> Thanks.
> Vikas Malik


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


Re: jmeter to store responses in recording controller.

Posted by Deepak Shetty <sh...@gmail.com>.
>2. Re-run the recorded HTTP requests in testing phase and compare the
responses we get now against the samples stored in step 1.
Such an approach is not feasible in my opinion - You are basically stating
that your website has no dynamic data at all (in which case is it static?)
as well as that even simple UI changes should cause your test to break which
is more trouble than the benefit it gives - assuming you are testing a
website (rather than say webservices).

regards
deepak


On Thu, Mar 24, 2011 at 11:11 PM, Vikas Malik <vi...@shop2020.in>wrote:

> Hello,
>
> I am using jmeter for functional testing the website. I am trying to store
> the responses while recording the HTTP request traffic using HTTP proxy
> server, but there does not seem to be any option in jmeter to store
> responses.
>
> Basically I am trying to do the following. Please let me know if it is
> possible to do so using jmeter, if yes, any pointers how to go about it
> will
> be very useful.
>
> 1. Store the http traffic(both request and response) using HTTP proxy.
> Store
> the responses as samples.
> 2. Re-run the recorded HTTP requests in testing phase and compare the
> responses we get now against the samples stored in step 1. Any mismatch
> should fail the test.
>
> Thanks.
> Vikas Malik
>