[Webtest] How to read dbunit-export-files as webtestproperties

webtest@lists.canoo.com webtest@lists.canoo.com
Thu, 12 Jan 2006 17:20:16 +0100


This is a multi-part message in MIME format.

--=-------------11370828173492987271
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

Hello,

Lothar and Denis thanks for the quick help.

I'm a novice in XML, XSL, ant and WebTest but there is the problem,
that I'll need the COL1, COL2 several times in my step. 
Can I use the property-file as property-table or an ImportDataStep.

I'll have do a for-each loop in the nested-step.
Something like that:
<webtest>
<invoke url=""/>
[...]
<step>
for each cutsomer in XML-FILE
do
   <!-- webtest-step -->
   <clickLink label="${COL1}"/>
   <verifyText text="${COL2}"/>
done
</step>
[...]
</webtest>

COL1, COL2 etc. are the looping names of the values.
COL1 has multiple-values ...

So is there any idea how i can do my work?

I want to use dbunit to get no extra sql-statement which 
I'll have to transform in MS-EXCEL so I can use ImportData. 


@Denis, thanks for the xsl-file I'll correct it and attached it for other user.


______________________________________________________________________
XXL-Speicher, PC-Virenschutz, Spartarife & mehr: Nur im WEB.DE Club!		
Jetzt gratis testen! http://freemail.web.de/home/landingpad/?mc=021130


--=-------------11370828173492987271
Content-Type: text/xml;
 name="SelectData2Webtest.xsl"
Content-Disposition: attachment;
 filename="SelectData2Webtest.xsl"
Content-Transfer-Encoding: 7bit

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- generate a text file -->
        <xsl:output method="text"/>

<!-- Don't copy the blank, ... from the original file -->
        <xsl:template match="text()"/>

        <xsl:template match="/">
                <xsl:apply-templates select="/dataset/FOO/"/>
        </xsl:template>

        <xsl:template match="FOO">
          <!-- for each attribute of FOO -->
          <xsl:for-each select="@*">
<!-- write the name of the attribte, a colon, the value of the -->
<!-- attribute, and a new line.-->
                <!-- <xsl:value-of select="concat(name(), ': ',text(), '&#x0a;')"/> -->
                <xsl:value-of select="concat(name(),'=',string(), '&#x0a;')"/>
            </xsl:for-each>
        </xsl:template>
</xsl:stylesheet>
--=-------------11370828173492987271--