jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: How to use XPath Assertion on a substring of the sampler response?
Date Tue, 02 Feb 2010 10:18:22 GMT
On 02/02/2010, Andrey Pohilko <apc@fininfor.ru> wrote:
> Unfortunately, there's no way to call Assertion on non-sampler element.

An Assertion doesn't make sense unless there is a sample result to
which it can apply.

>  You still can use "If" controller to make some custom check on your variable
>  value, and do always-failing-assertion sample inside it.

Use Test Action to create an always failing sample.

As already noted, it's probably simpler to use a Java Request/JavaTest
to create a sample with the contents of the variable, and then apply
the Assertion(s) to that.

However in a future release it should be possible to allow some
Assertions to apply to a variable, rather than the content of the
sample result.

>
>  С уважением,
>  Андрей Похилько
>
> -----Original Message-----
>  From: David Levine [mailto:eniveld@gmail.com]
>  Sent: Monday, February 01, 2010 11:50 PM
>  To: jmeter-user@jakarta.apache.org
>  Subject: How to use XPath Assertion on a substring of the sampler response?
>
>  Hi,
>
>
>  I've got a situation where my WebService (SOAP) Request is returning a
>  string which happens to be a nested XML document with its own schema.  So
>  it's an XML document nested inside the XML document returned by the SOAP
>  call.  Consequently, XPath can't interpret the structure of the nested XML
>  document, so I have to treat it as a string and for example use the XPath
>  contains() function.
>
>
>
>  Is there any way I can write an XPath Assertion against this nested XML
>  document in such a way that it interprets the structure of the nested XML?
>
>
>
>  I thought about trying to do it in two steps that might be:
>
>                Step 1: Use XPath Extractor to extract the string to a JMeter
>  variable
>
>                Step 2: Use XPath Assertion on the variable as opposed to
>  sampler output
>
>
>
>  But I don't think there's any way to do step #2.  Is there any relatively
>  simple way to do what I want to do?
>
>
>
>  My fallback is to use the XPath contains() function to do substring
>  searching on the nested XML, but unfortunately since match() is not
>  supported, this is very fragile.
>
>
>
>  Any thoughts would be greatly appreciated!
>
>
>
>  David
>
>
>
> ---------------------------------------------------------------------
>  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


Mime
View raw message