You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by _elgato <el...@gmail.com> on 2020/04/03 11:34:00 UTC

How to save response on error

Hi everyone,

I have a couple of questions:

I need to save the server response on error. The HTTP requests has an
assertion that checks the response body contains a specific text in the
<title> tag.

I have read in
https://www.blazemeter.com/blog/how-to-save-response-data-in-jmeter/ that
there are a few ways of doing this:

   1.
   https://jmeter.apache.org/usermanual/component_reference.html#Save_Responses_to_a_file
   2.
   https://jmeter.apache.org/usermanual/component_reference.html#View_Results_Tree
   3.
   https://jmeter.apache.org/usermanual/properties_reference.html#results_file_config

I will be running jmeter in non-GUI mode, so which is the better approach
to doing what I need to do?

Also, another question, I've tried adding Save Response Data (XML) to an
Aggregate Report item but it seems it does not work that way, are all Save
Configurations available for all types?

Thank you.
Regards.

Re: How to save response on error

Posted by _elgato <el...@gmail.com>.
Certainly,

This is the result file:
https://gist.github.com/elgatov/1b9bacefb982f873c21edb906b3451b6
And this is the configuration of the View Tree Result listener:
https://gist.github.com/elgatov/cb89a22675d77b5a0f86d846425a6eda

Log does not show anything about why it can't be opened and I tried both
with relative path and absolute path.

Thank you.
Regards.


On Fri, Apr 3, 2020 at 9:11 PM Philippe Mouawad <ph...@gmail.com>
wrote:

> Hello,
> The file generated is usually opened in View Results Tree, you reference it
> in filename field and type enter.
>
> 1) Can you confirm it has a XML format ? if not, check COnfigure button and
> that you have all fields checked except CSV
> 2) Can you share it using some sharing tool ?
>
> Thanks
>
> On Fri, Apr 3, 2020 at 6:26 PM _elgato <el...@gmail.com> wrote:
>
> > Hi Philippe, thanks for your response.
> >
> > I finally set a View Results Tree with result file
> > transaction_resulttree.xml
> >
> > The file is 144kb and contains lines as follows:
> >
> > sample.responseHeader.Attribute:class
> sample.requestHeader.Attribute:class
> > sample.responseData.Element:Text sample.responseData.Attribute:class
> > sample.Attribute:ts sample.Attribute:lb sample.Attribute:rc
> > sample.Attribute:rm sample.Attribute:tn Attribute:version
> > java.lang.String java.lang.String Non-TEXT response data, cannot record:
> ()
> > java.lang.String 1585928938746 Completar login 200 Number of samples in
> > transaction : 3, number of failing samples : 1 Thread Group 1-234 12
> >
> > However I am not able to load the file in the View Results Tree listener.
> > How should I open this file?
> >
> > Thanks again for your help.
> > Regards.
> > On Fri, Apr 3, 2020 at 1:40 PM Philippe Mouawad <
> > philippe.mouawad@gmail.com>
> > wrote:
> >
> > > Hello,
> > > Use one of those listeners:
> > >
> > >    -
> > >
> > >
> >
> https://jmeter.apache.org/usermanual/component_reference.html#Simple_Data_Writer
> > >    -
> > >
> > >
> >
> https://jmeter.apache.org/usermanual/component_reference.html#View_Results_Tree
> > >
> > > Then:
> > > - Check errors only
> > > - Click Configure and select all fields except CSV to get all details
> in
> > > XML
> > > - And fill a filename
> > >
> > > Regards
> > > Philippe M.
> > > Co-author of:
> > >
> > >    - https://leanpub.com/master-jmeter-from-load-test-to-devops
> > >    -
> > >
> > >
> >
> https://www.packtpub.com/programming/master-apache-jmeter-from-load-testing-to-devops
> > >
> > >
> > >
> > >
> > > On Fri, Apr 3, 2020 at 1:34 PM _elgato <el...@gmail.com>
> > wrote:
> > >
> > > > Hi everyone,
> > > >
> > > > I have a couple of questions:
> > > >
> > > > I need to save the server response on error. The HTTP requests has an
> > > > assertion that checks the response body contains a specific text in
> the
> > > > <title> tag.
> > > >
> > > > I have read in
> > > > https://www.blazemeter.com/blog/how-to-save-response-data-in-jmeter/
> > > that
> > > > there are a few ways of doing this:
> > > >
> > > >    1.
> > > >
> > > >
> > >
> >
> https://jmeter.apache.org/usermanual/component_reference.html#Save_Responses_to_a_file
> > > >    2.
> > > >
> > > >
> > >
> >
> https://jmeter.apache.org/usermanual/component_reference.html#View_Results_Tree
> > > >    3.
> > > >
> > > >
> > >
> >
> https://jmeter.apache.org/usermanual/properties_reference.html#results_file_config
> > > >
> > > > I will be running jmeter in non-GUI mode, so which is the better
> > approach
> > > > to doing what I need to do?
> > > >
> > > > Also, another question, I've tried adding Save Response Data (XML) to
> > an
> > > > Aggregate Report item but it seems it does not work that way, are all
> > > Save
> > > > Configurations available for all types?
> > > >
> > > > Thank you.
> > > > Regards.
> > > >
> > >
> > >
> > > --
> > > Cordialement.
> > > Philippe Mouawad.
> > >
> >
>
>
> --
> Cordialement.
> Philippe Mouawad.
>

Re: How to save response on error

Posted by Philippe Mouawad <ph...@gmail.com>.
Hello,
The file generated is usually opened in View Results Tree, you reference it
in filename field and type enter.

1) Can you confirm it has a XML format ? if not, check COnfigure button and
that you have all fields checked except CSV
2) Can you share it using some sharing tool ?

Thanks

On Fri, Apr 3, 2020 at 6:26 PM _elgato <el...@gmail.com> wrote:

> Hi Philippe, thanks for your response.
>
> I finally set a View Results Tree with result file
> transaction_resulttree.xml
>
> The file is 144kb and contains lines as follows:
>
> sample.responseHeader.Attribute:class sample.requestHeader.Attribute:class
> sample.responseData.Element:Text sample.responseData.Attribute:class
> sample.Attribute:ts sample.Attribute:lb sample.Attribute:rc
> sample.Attribute:rm sample.Attribute:tn Attribute:version
> java.lang.String java.lang.String Non-TEXT response data, cannot record: ()
> java.lang.String 1585928938746 Completar login 200 Number of samples in
> transaction : 3, number of failing samples : 1 Thread Group 1-234 12
>
> However I am not able to load the file in the View Results Tree listener.
> How should I open this file?
>
> Thanks again for your help.
> Regards.
> On Fri, Apr 3, 2020 at 1:40 PM Philippe Mouawad <
> philippe.mouawad@gmail.com>
> wrote:
>
> > Hello,
> > Use one of those listeners:
> >
> >    -
> >
> >
> https://jmeter.apache.org/usermanual/component_reference.html#Simple_Data_Writer
> >    -
> >
> >
> https://jmeter.apache.org/usermanual/component_reference.html#View_Results_Tree
> >
> > Then:
> > - Check errors only
> > - Click Configure and select all fields except CSV to get all details in
> > XML
> > - And fill a filename
> >
> > Regards
> > Philippe M.
> > Co-author of:
> >
> >    - https://leanpub.com/master-jmeter-from-load-test-to-devops
> >    -
> >
> >
> https://www.packtpub.com/programming/master-apache-jmeter-from-load-testing-to-devops
> >
> >
> >
> >
> > On Fri, Apr 3, 2020 at 1:34 PM _elgato <el...@gmail.com>
> wrote:
> >
> > > Hi everyone,
> > >
> > > I have a couple of questions:
> > >
> > > I need to save the server response on error. The HTTP requests has an
> > > assertion that checks the response body contains a specific text in the
> > > <title> tag.
> > >
> > > I have read in
> > > https://www.blazemeter.com/blog/how-to-save-response-data-in-jmeter/
> > that
> > > there are a few ways of doing this:
> > >
> > >    1.
> > >
> > >
> >
> https://jmeter.apache.org/usermanual/component_reference.html#Save_Responses_to_a_file
> > >    2.
> > >
> > >
> >
> https://jmeter.apache.org/usermanual/component_reference.html#View_Results_Tree
> > >    3.
> > >
> > >
> >
> https://jmeter.apache.org/usermanual/properties_reference.html#results_file_config
> > >
> > > I will be running jmeter in non-GUI mode, so which is the better
> approach
> > > to doing what I need to do?
> > >
> > > Also, another question, I've tried adding Save Response Data (XML) to
> an
> > > Aggregate Report item but it seems it does not work that way, are all
> > Save
> > > Configurations available for all types?
> > >
> > > Thank you.
> > > Regards.
> > >
> >
> >
> > --
> > Cordialement.
> > Philippe Mouawad.
> >
>


-- 
Cordialement.
Philippe Mouawad.

Re: How to save response on error

Posted by _elgato <el...@gmail.com>.
Hi Philippe, thanks for your response.

I finally set a View Results Tree with result file
transaction_resulttree.xml

The file is 144kb and contains lines as follows:

sample.responseHeader.Attribute:class sample.requestHeader.Attribute:class
sample.responseData.Element:Text sample.responseData.Attribute:class
sample.Attribute:ts sample.Attribute:lb sample.Attribute:rc
sample.Attribute:rm sample.Attribute:tn Attribute:version
java.lang.String java.lang.String Non-TEXT response data, cannot record: ()
java.lang.String 1585928938746 Completar login 200 Number of samples in
transaction : 3, number of failing samples : 1 Thread Group 1-234 12

However I am not able to load the file in the View Results Tree listener.
How should I open this file?

Thanks again for your help.
Regards.
On Fri, Apr 3, 2020 at 1:40 PM Philippe Mouawad <ph...@gmail.com>
wrote:

> Hello,
> Use one of those listeners:
>
>    -
>
> https://jmeter.apache.org/usermanual/component_reference.html#Simple_Data_Writer
>    -
>
> https://jmeter.apache.org/usermanual/component_reference.html#View_Results_Tree
>
> Then:
> - Check errors only
> - Click Configure and select all fields except CSV to get all details in
> XML
> - And fill a filename
>
> Regards
> Philippe M.
> Co-author of:
>
>    - https://leanpub.com/master-jmeter-from-load-test-to-devops
>    -
>
> https://www.packtpub.com/programming/master-apache-jmeter-from-load-testing-to-devops
>
>
>
>
> On Fri, Apr 3, 2020 at 1:34 PM _elgato <el...@gmail.com> wrote:
>
> > Hi everyone,
> >
> > I have a couple of questions:
> >
> > I need to save the server response on error. The HTTP requests has an
> > assertion that checks the response body contains a specific text in the
> > <title> tag.
> >
> > I have read in
> > https://www.blazemeter.com/blog/how-to-save-response-data-in-jmeter/
> that
> > there are a few ways of doing this:
> >
> >    1.
> >
> >
> https://jmeter.apache.org/usermanual/component_reference.html#Save_Responses_to_a_file
> >    2.
> >
> >
> https://jmeter.apache.org/usermanual/component_reference.html#View_Results_Tree
> >    3.
> >
> >
> https://jmeter.apache.org/usermanual/properties_reference.html#results_file_config
> >
> > I will be running jmeter in non-GUI mode, so which is the better approach
> > to doing what I need to do?
> >
> > Also, another question, I've tried adding Save Response Data (XML) to an
> > Aggregate Report item but it seems it does not work that way, are all
> Save
> > Configurations available for all types?
> >
> > Thank you.
> > Regards.
> >
>
>
> --
> Cordialement.
> Philippe Mouawad.
>

Re: How to save response on error

Posted by Philippe Mouawad <ph...@gmail.com>.
Hello,
Use one of those listeners:

   -
   https://jmeter.apache.org/usermanual/component_reference.html#Simple_Data_Writer
   -
   https://jmeter.apache.org/usermanual/component_reference.html#View_Results_Tree

Then:
- Check errors only
- Click Configure and select all fields except CSV to get all details in XML
- And fill a filename

Regards
Philippe M.
Co-author of:

   - https://leanpub.com/master-jmeter-from-load-test-to-devops
   -
   https://www.packtpub.com/programming/master-apache-jmeter-from-load-testing-to-devops




On Fri, Apr 3, 2020 at 1:34 PM _elgato <el...@gmail.com> wrote:

> Hi everyone,
>
> I have a couple of questions:
>
> I need to save the server response on error. The HTTP requests has an
> assertion that checks the response body contains a specific text in the
> <title> tag.
>
> I have read in
> https://www.blazemeter.com/blog/how-to-save-response-data-in-jmeter/ that
> there are a few ways of doing this:
>
>    1.
>
> https://jmeter.apache.org/usermanual/component_reference.html#Save_Responses_to_a_file
>    2.
>
> https://jmeter.apache.org/usermanual/component_reference.html#View_Results_Tree
>    3.
>
> https://jmeter.apache.org/usermanual/properties_reference.html#results_file_config
>
> I will be running jmeter in non-GUI mode, so which is the better approach
> to doing what I need to do?
>
> Also, another question, I've tried adding Save Response Data (XML) to an
> Aggregate Report item but it seems it does not work that way, are all Save
> Configurations available for all types?
>
> Thank you.
> Regards.
>


-- 
Cordialement.
Philippe Mouawad.