R: [Webtest] Validating SOAP response against XML Schema

Caleandro Caleandro" <kalosandros@katamail.com
Fri, 24 Nov 2006 15:15:47 +0100

Hi, Marc
Yes, i need to obtain a test report where the step of xmlvalidation is shown
as succeeded o failed as the case.
Now I'm using the build 1245 of Webtest 2.0.

The portion of my script is, by example:
 <antWrapper description="prova di ANT Wrapping">
    <record name="validazione.txt" action="start"/>
    <xmlvalidate failonerror="no" warn="yes"
    	<classpath path="D:\JavaTools\xerces-2_8_1" location="xercesImpl.jar"
    	<attribute name="http://xml.org/sax/features/validation"
      <attribute name="http://apache.org/xml/features/validation/schema"
    	<attribute name="http://xml.org/sax/features/namespaces" value="true"/>
tion" value="D:\TestsRoot\...\Envelope.xsd"/>
    <record name="log.txt" action="stop"/>
 <invoke url="file://D:\CanooWebTest_2_0\jobScripts\validazione.txt"/>
 		<verifyText text="is not a valid XML document" description="verifica
validazione XML"/>

As one can see, the script tries to verify the absence of invalidation
message in the ant-step log file, because of: if the same fail, Webtest
would report anyway the success of wrapped step.

This solution, I admit, is a bit tricky, and therefore I look for a more
elegant solution.

As soon  I can, I will download and try latest Webtest build.

Thank you very much for soggestions.

-----Messaggio originale-----
Da: webtest-admin@lists.canoo.com
[mailto:webtest-admin@lists.canoo.com]Per conto di Marc Guillemot
Inviato: giovedý 23 novembre 2006 16.26
A: webtest@lists.canoo.com
Oggetto: Re: [Webtest] Validating SOAP response against XML Schema


you want the test to fail if xmlvalidate fails? Is xmlvalidate's
failonerror set to true? If it is the case and if the validation fails,
then the webtest should fail too.

Btw, it probably works better with a post release 2.1 build of WebTest
(for instance the last one) as the normal ant task are now handled just
like WebTest steps.


Caleandro wrote:
> Hi all,
> In a test-case  I have to validate a SOAP response message coming from a
> web-service against his XML Schema.
> I tried to do this with an <antWrapper> step by <xmlvalidate> task and all
> goes fine but, how could I obtain the Canoo step failure when the
> fails?
> The wrapped step always return ok. Do Anyone knows a more suitable way to
> the same thing?
> Tanks in advance for any suggestion.
> Vito
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest

WebTest mailing list