jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak Shetty <shet...@gmail.com>
Subject Re: How to Parse Web Service Response to Delimited Text
Date Wed, 17 Mar 2010 21:36:22 GMT
You can always check whether the response was a success or not .(though you
might need to add assertions for business errors, i believe SOAP faults
should be flagged automatically)
The listener is passed a sampleResult object , the javadoc for which is
available
http://jakarta.apache.org/jmeter/api/org/apache/jmeter/samplers/SampleResult.html
(isSuccessful())

I prefer parsing response files to writing custom listeners (avoids usually
buggy java coding!)

regards
deepak

On Wed, Mar 17, 2010 at 2:17 PM, Prakash Viswanathan <
rushtoprakash@gmail.com> wrote:

> Excellent, Didn't knew about Xpath Extractors and Bean Shell Listeners.
> Thank you Deepak.
>
> I wonder how do make this listener work only for valid responses not for
> SoapFaults, should that be part of my script code ?
>
>
> On Wed, Mar 17, 2010 at 3:54 PM, Deepak Shetty <shettyd@gmail.com> wrote:
>
> > Hi
> > concat function didnt seem to work (if you can get it to work on JMeter
> > then
> > great).
> > Im assuming you only have 1 car element per response
> > Write 4 XPATH extractors , that extract into variables
> > /CarsQueryResponse/cars/car/name/text()  -->carName
> > /CarsQueryResponse/cars/car/year/text()   -->year
> > etc etc..
> > And in jmeter.properties use sample_variables to specify carName,year so
> > that this will be written into the result file,
> > you can then extract them whenever you want with whatever delimiter.
> >
> > Alternately you can write a BeanShell Listener which can do whatever you
> > code it to do(obtain a lock , read variables , append to file , release
> > lock)
> >
> > regards
> > deepak
> >
> > On Wed, Mar 17, 2010 at 1:48 PM, Prakash Viswanathan <
> > rushtoprakash@gmail.com> wrote:
> >
> > > Is there a way in Jmeter to parse the web service response and write
> them
> > > into a CSV or some character Delimited File.
> > >
> > > e.g.
> > >
> > > Lets say that the following comes as the body in the web service
> > responses
> > > in TWO consecutive threads
> > >
> > > <CarsQueryResponse>
> > > <cars>
> > > <car>
> > > <name>Honda</name>
> > > <year>2010</year>
> > > <model>Accord</model>
> > > <price>23,000</price>
> > > </car>
> > > </cars>
> > > </CarsQueryResponse>
> > >
> > > <CarsQueryResponse>
> > > <cars>
> > > <car>
> > > <name>Toyota</name>
> > > <year>2010</year>
> > > <model>Camry</model>
> > > <price>22,500</price>
> > > </car>
> > > </cars>
> > > </CarsQueryResponse>
> > >
> > >
> > > I would like to parse this XML and get the following in the output file
> > >
> > > Honda~2010~Accord~23,000
> > > Toyota~2010~Camry~22,500
> > >
> > > where ~ is the separator character.
> > >
> > > Any pointers here will be very helpful.
> > >
> > > Thanks
> > > Prakash
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message