Hi,

I think a good way to do this is with a <groovy> step.

Something like :

<groovy file="readXml.groovy">

with a readXml.groovy filled with

import groovy.xml.DOMBuilder
import groovy.xml.dom.DOMCategory

homedir = new File('.') //here, you replace the '.' with a property containing the resultPath of Webtest. There should be an easy way to do it

def name=homedir.name
def result_name = "$name/WebTestReport.xml"
def doc = DOMBuilder.parse(new FileReader(result_name))
def summary = doc.documentElement
def steps
/*with Groovy, you can navigate in the dom by appending a tag name and get the tag Object
example : in a xml file like
<a>
    <b attribute=value>
    </b>
</a>
you can get the 'b' node by
a=doc.documentElement
bnode=a.b
and the attribute by
battribute = a.b.@'attribute' or something like this
more info on the Groovy web site <http://groovy.codehaus.org/Reading+XML+using+Groovy%27s+DOMCategory>
use (DOMCategory) {
steps = summary.testresult.results.step.result.'*' for (step in steps){
            if (step.name()=='failed'){
                   // do some job
            }
       }
}

I haven't tested this code (but it's based on a working code of mine)
You can get information on how Groovy works on the Groovy website

Hope that helps

Florent

Willi Kuhnis a écrit :
Hi,

at  the end of my Webtest project I would like to check,
if a test failed.
I could do it this way: if in WebTestOverview.xml is this text: successful='no'.

How can I do it?
Or is there a better way?


Thanks a lot for any tips

Willi Kuhnis
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


--
Pingwy
27, rue des arènes
49100 Angers

Reply via email to