You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by mh...@aol.com on 2008/04/11 18:19:55 UTC
Response Assertion of only part of response?
I get a large XML response from a SOAP request.? Includes header, body, etc.? Is there someway to only do a Response Assertion check against a small part of that assertion? say only the actual values returned by the soap response? and if so how?
here is the SOAP response I get back (in Jmeter text view):
Re: Response Assertion of only part of response?
Posted by sebb <se...@gmail.com>.
In 11/04/2008, mhudson1976@aol.com <mh...@aol.com> wrote:
>
> Sorry sent my msg before I finished including all of it, here is the SOAP response I am trying to parse and run a assertion check against:
>
> <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetUKLocationByTownResponse xmlns="http://www.webserviceX.NET"><GetUKLocationByTownResult><NewDataSet>? <Table>??? <Town>Eltham</Town>??? <County>Greater London</County>??? <PostCode>SE9</PostCode>? </Table>? <Table>??? <Town>Feltham</Town>??? <County>Greater London</County>??? <PostCode>TW13</PostCode>? </Table>? <Table>??? <Town>Meltham</Town>??? <County>West Yorkshire</County>??? <PostCode>HD7</PostCode>? </Table>? <Table>??? <Town>New Eltham</Town>??? <County>Greater London</County>??? <PostCode>SE9</PostCode>? </Table></NewDataSet></GetUKLocationByTownR
esu
> lt></GetUKLocationByTownResponse></soap:Body></soap:Envelope>
>
> and I just want to check that
>
> Town>Eltham</Town>
>
>
>
> Is text or not numeric
Not numeric:
Town>\D+</Town>
Not sure what you mean by text - this email is text but it contains numbers.
>
> Also would like to know how I might run an assertion against the above XML to check that
>
> PostCode>SE9</PostCode>
>
> "SE9" is only 3 characters long.?
>
The following Response Assertion would check that there was a PostCode
of 3 characters:
PostCode>...</PostCode>
You might want to use [A-Z][A-Z]\d instead of ...
> So any ideas on how I might use Jmeter to only run an assertion against a small part of these results and not the entire XML response?? a few examples would be VERY helpful :)
>
> Thanks
>
>
>
>
>
>
> -----Original Message-----
> From: sebb <se...@gmail.com>
> To: JMeter Users List <jm...@jakarta.apache.org>
> Sent: Fri, 11 Apr 2008 12:45 pm
> Subject: Re: Response Assertion of only part of response?
>
>
>
>
>
>
>
>
>
>
> On 11/04/2008, mhudson1976@aol.com <mh...@aol.com> wrote:
> > I get a large XML response from a SOAP request.? Includes header, body, etc.?
>
> Do you?
>
> > Is there someway to only do a Response Assertion check against a small part of
> that assertion? say only the actual values returned by the soap response? and if
> so how?
> >
>
> JMeter stores the response data as sent by the server; it only removes
> HTTP headers, not XML or HTML headers.
>
> Just add whatever context is needed to ensure that the correct part of
> the response is matched.
>
> You might find the XPath Assertion useful here.
>
> > here is the SOAP response I get back (in Jmeter text view):
> >
> >
> Don't post attachments. If you want to provide a screenshot, upload it
> somewhere and send a link.
>
>
> ---------------------------------------------------------------------
> 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: Response Assertion of only part of response?
Posted by mh...@aol.com.
Sorry sent my msg before I finished including all of it, here is the SOAP response I am trying to parse and run a assertion check against:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetUKLocationByTownResponse xmlns="http://www.webserviceX.NET"><GetUKLocationByTownResult><NewDataSet>? <Table>??? <Town>Eltham</Town>??? <County>Greater London</County>??? <PostCode>SE9</PostCode>? </Table>? <Table>??? <Town>Feltham</Town>??? <County>Greater London</County>??? <PostCode>TW13</PostCode>? </Table>? <Table>??? <Town>Meltham</Town>??? <County>West Yorkshire</County>??? <PostCode>HD7</PostCode>? </Table>? <Table>??? <Town>New Eltham</Town>??? <County>Greater London</County>??? <PostCode>SE9</PostCode>? </Table></NewDataSet></GetUKLocationByTownResu
lt></GetUKLocationByTownResponse></soap:Body></soap:Envelope>
and I just want to check that
Town>Eltham</Town>
Is text or not numeric
Also would like to know how I might run an assertion against the above XML to check that
PostCode>SE9</PostCode>
"SE9" is only 3 characters long.?
So any ideas on how I might use Jmeter to only run an assertion against a small part of these results and not the entire XML response?? a few examples would be VERY helpful :)
Thanks
-----Original Message-----
From: sebb <se...@gmail.com>
To: JMeter Users List <jm...@jakarta.apache.org>
Sent: Fri, 11 Apr 2008 12:45 pm
Subject: Re: Response Assertion of only part of response?
On 11/04/2008, mhudson1976@aol.com <mh...@aol.com> wrote:
> I get a large XML response from a SOAP request.? Includes header, body, etc.?
Do you?
> Is there someway to only do a Response Assertion check against a small part of
that assertion? say only the actual values returned by the soap response? and if
so how?
>
JMeter stores the response data as sent by the server; it only removes
HTTP headers, not XML or HTML headers.
Just add whatever context is needed to ensure that the correct part of
the response is matched.
You might find the XPath Assertion useful here.
> here is the SOAP response I get back (in Jmeter text view):
>
>
Don't post attachments. If you want to provide a screenshot, upload it
somewhere and send a link.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: Response Assertion of only part of response?
Posted by sebb <se...@gmail.com>.
On 11/04/2008, mhudson1976@aol.com <mh...@aol.com> wrote:
> I get a large XML response from a SOAP request.? Includes header, body, etc.?
Do you?
> Is there someway to only do a Response Assertion check against a small part of that assertion? say only the actual values returned by the soap response? and if so how?
>
JMeter stores the response data as sent by the server; it only removes
HTTP headers, not XML or HTML headers.
Just add whatever context is needed to ensure that the correct part of
the response is matched.
You might find the XPath Assertion useful here.
> here is the SOAP response I get back (in Jmeter text view):
>
>
Don't post attachments. If you want to provide a screenshot, upload it
somewhere and send a link.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org