You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Tim Boonstra <ti...@q-go.com> on 2008/04/02 17:16:58 UTC

XPath assertion with namespace not working (namespace is declared in root element

Hello,

 

We're trying to use JMeter  for testing our SOAP webservices. Everything
seems to work ok if I use Response Assertion, but I'm unable to get
tests working with XPath assertion.

 

I setup a SOAP Webservice Request which sends a xml package looking like
this (snipped)

 

<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://soap.q-go.net/soap_client/wsdl/schema"><SOAP-ENV:Body>
<ns1:SOAP_ask>...... SNIP...

 

and in the result tree I see my SOAP response XML package nicely
formatted like:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://soap.q-go.net/soap_client/wsdl/schema"><SOAP-ENV:Body>
<ns1:SOAP_askResponse><ns1:resp>match</ns1:resp>.. .SNIP....

 

 

As a simple test I added an XPath assertion: //ns1:resp

With "use namespaces" set to true..

 

However I keep receiving the error message "Prefix must resolve to a
Namespace: ns1". I tested this with JMeter 2.3.1 and nightly build
r642735 

 

In the documentation is stated you can only use the Namespace from the
root element, where the ns1 is defined in my case, in the send package
AND the received package..

 

Does anyone have an idea how to fix this problem? 

 

I seem to be unable to get the suggested local-name() tip suggested to
work ..

 

 

Greetings Tim

 


Re: XPath assertion with namespace not working (namespace is declared in root element

Posted by sebb <se...@gmail.com>.
On 07/04/2008, Tim Boonstra <ti...@q-go.com> wrote:
> I've tryed it in different ways now but i'm unable to get it to work..
>
>  See screenshot on how I set it up..
>
>  http://img88.imageshack.us/my.php?image=jemeterxpathnp2.jpg
>
>  How did you set it up?
>

See my previous message.

>
>
>
>  -----Original Message-----
>  From: sebb [mailto:sebbaz@gmail.com]
>  Sent: 03-04-2008 11:01
>  To: JMeter Users List
>  Subject: Re: XPath assertion with namespace not working (namespace is
>  declared in root element
>
>  Works fine for me in 2.3.1 and the current SVN.
>
>  I used
>
>  <?xml version="1.0" encoding="UTF-8"?>
>  <SOAP-ENV:Envelope
>  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>  xmlns:ns1="http://soap.q-go.net/soap_client/wsdl/schema">
>  <SOAP-ENV:Body>
>  <ns1:SOAP_askResponse>
>  <ns1:resp>match</ns1:resp>
>  </ns1:SOAP_askResponse>
>  </SOAP-ENV:Body>
>  </SOAP-ENV:Envelope>
>
>  in a Java Request sampler response data and added the XPath assertion to
>  that.
>
>
>  On 02/04/2008, Tim Boonstra <ti...@q-go.com> wrote:
>  > Hello,
>  >
>  >
>  >
>  >  We're trying to use JMeter  for testing our SOAP webservices.
>  Everything
>  >  seems to work ok if I use Response Assertion, but I'm unable to get
>  >  tests working with XPath assertion.
>  >
>  >
>  >
>  >  I setup a SOAP Webservice Request which sends a xml package looking
>  like
>  >  this (snipped)
>  >
>  >
>  >
>  >  <?xml version="1.0" encoding="UTF-8"?>
>  >
>  >  <SOAP-ENV:Envelope
>  >  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>  >
>  xmlns:ns1="http://soap.q-go.net/soap_client/wsdl/schema"><SOAP-ENV:Body>
>  >  <ns1:SOAP_ask>...... SNIP...
>  >
>  >
>  >
>  >  and in the result tree I see my SOAP response XML package nicely
>  >  formatted like:
>  >
>  >  <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
>  >  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>  >
>  xmlns:ns1="http://soap.q-go.net/soap_client/wsdl/schema"><SOAP-ENV:Body>
>  >  <ns1:SOAP_askResponse><ns1:resp>match</ns1:resp>.. .SNIP....
>  >
>  >
>  >
>  >
>  >
>  >  As a simple test I added an XPath assertion: //ns1:resp
>  >
>  >  With "use namespaces" set to true..
>  >
>  >
>  >
>  >  However I keep receiving the error message "Prefix must resolve to a
>  >  Namespace: ns1". I tested this with JMeter 2.3.1 and nightly build
>  >  r642735
>  >
>  >
>  >
>  >  In the documentation is stated you can only use the Namespace from
>  the
>  >  root element, where the ns1 is defined in my case, in the send
>  package
>  >  AND the received package..
>  >
>  >
>  >
>  >  Does anyone have an idea how to fix this problem?
>  >
>  >
>  >
>  >  I seem to be unable to get the suggested local-name() tip suggested
>  to
>  >  work ..
>  >
>  >
>  >
>  >
>  >
>  >  Greetings Tim
>  >
>  >
>  >
>  >
>
>
> ---------------------------------------------------------------------
>  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: XPath assertion with namespace not working (namespace is declared in root element

Posted by Tim Boonstra <ti...@q-go.com>.
I've tryed it in different ways now but i'm unable to get it to work..

See screenshot on how I set it up..

http://img88.imageshack.us/my.php?image=jemeterxpathnp2.jpg

How did you set it up?



-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: 03-04-2008 11:01
To: JMeter Users List
Subject: Re: XPath assertion with namespace not working (namespace is
declared in root element

Works fine for me in 2.3.1 and the current SVN.

I used

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://soap.q-go.net/soap_client/wsdl/schema">
<SOAP-ENV:Body>
<ns1:SOAP_askResponse>
<ns1:resp>match</ns1:resp>
</ns1:SOAP_askResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

in a Java Request sampler response data and added the XPath assertion to
that.


On 02/04/2008, Tim Boonstra <ti...@q-go.com> wrote:
> Hello,
>
>
>
>  We're trying to use JMeter  for testing our SOAP webservices.
Everything
>  seems to work ok if I use Response Assertion, but I'm unable to get
>  tests working with XPath assertion.
>
>
>
>  I setup a SOAP Webservice Request which sends a xml package looking
like
>  this (snipped)
>
>
>
>  <?xml version="1.0" encoding="UTF-8"?>
>
>  <SOAP-ENV:Envelope
>  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>
xmlns:ns1="http://soap.q-go.net/soap_client/wsdl/schema"><SOAP-ENV:Body>
>  <ns1:SOAP_ask>...... SNIP...
>
>
>
>  and in the result tree I see my SOAP response XML package nicely
>  formatted like:
>
>  <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
>  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>
xmlns:ns1="http://soap.q-go.net/soap_client/wsdl/schema"><SOAP-ENV:Body>
>  <ns1:SOAP_askResponse><ns1:resp>match</ns1:resp>.. .SNIP....
>
>
>
>
>
>  As a simple test I added an XPath assertion: //ns1:resp
>
>  With "use namespaces" set to true..
>
>
>
>  However I keep receiving the error message "Prefix must resolve to a
>  Namespace: ns1". I tested this with JMeter 2.3.1 and nightly build
>  r642735
>
>
>
>  In the documentation is stated you can only use the Namespace from
the
>  root element, where the ns1 is defined in my case, in the send
package
>  AND the received package..
>
>
>
>  Does anyone have an idea how to fix this problem?
>
>
>
>  I seem to be unable to get the suggested local-name() tip suggested
to
>  work ..
>
>
>
>
>
>  Greetings Tim
>
>
>
>

---------------------------------------------------------------------
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: XPath assertion with namespace not working (namespace is declared in root element

Posted by sebb <se...@gmail.com>.
Works fine for me in 2.3.1 and the current SVN.

I used

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://soap.q-go.net/soap_client/wsdl/schema">
<SOAP-ENV:Body>
<ns1:SOAP_askResponse>
<ns1:resp>match</ns1:resp>
</ns1:SOAP_askResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

in a Java Request sampler response data and added the XPath assertion to that.


On 02/04/2008, Tim Boonstra <ti...@q-go.com> wrote:
> Hello,
>
>
>
>  We're trying to use JMeter  for testing our SOAP webservices. Everything
>  seems to work ok if I use Response Assertion, but I'm unable to get
>  tests working with XPath assertion.
>
>
>
>  I setup a SOAP Webservice Request which sends a xml package looking like
>  this (snipped)
>
>
>
>  <?xml version="1.0" encoding="UTF-8"?>
>
>  <SOAP-ENV:Envelope
>  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>  xmlns:ns1="http://soap.q-go.net/soap_client/wsdl/schema"><SOAP-ENV:Body>
>  <ns1:SOAP_ask>...... SNIP...
>
>
>
>  and in the result tree I see my SOAP response XML package nicely
>  formatted like:
>
>  <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
>  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>  xmlns:ns1="http://soap.q-go.net/soap_client/wsdl/schema"><SOAP-ENV:Body>
>  <ns1:SOAP_askResponse><ns1:resp>match</ns1:resp>.. .SNIP....
>
>
>
>
>
>  As a simple test I added an XPath assertion: //ns1:resp
>
>  With "use namespaces" set to true..
>
>
>
>  However I keep receiving the error message "Prefix must resolve to a
>  Namespace: ns1". I tested this with JMeter 2.3.1 and nightly build
>  r642735
>
>
>
>  In the documentation is stated you can only use the Namespace from the
>  root element, where the ns1 is defined in my case, in the send package
>  AND the received package..
>
>
>
>  Does anyone have an idea how to fix this problem?
>
>
>
>  I seem to be unable to get the suggested local-name() tip suggested to
>  work ..
>
>
>
>
>
>  Greetings Tim
>
>
>
>

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