[Webtest] How to read dbunit-export-files as webtestproperties
Denis N. Antonioli
webtest@lists.canoo.com
Thu, 12 Jan 2006 14:13:35 +0100
Hi
I'm assuming that your process is now:
1) query the oracle-db with dbunit and write the result to xml files
2) start webtest.
I would change it to:
1) query the oracle-db with dbunit and write the result to xml files
2) convert each xml file to a property file. This is easily done from =20=
ant with the task <style> and a simple xsl transformation.
3) read the property file with ant's <property> task.
4) start webtest.
To get you started, here is a sample xsl transformation. YMMV
<xsl:stylesheet version=3D"1.0"
xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform">
<!-- generate a text file -->
<xsl:output method=3D"text"/>
<!-- Don't copy the blank, ... from the original file -->
<xsl:template match=3D"text()"/>
<xsl:template match=3D"/">
<xsl:apply-templates select=3D"/dataset/FOO"/>
</xsl:template>
<xsl:template match=3D"FOO">
<!-- for each attribute of FOO -->
<xsl:for-each select=3D"@*">
<!-- write the name of the attribte, a colon, the value of the -->
<!-- attribute, and a new line.-->
<xsl:value-of select=3D"concat(name(), ': ',text(), =
'
')"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Best
dna
On 12 janv. 06, at 13:37, St_Germain@web.de wrote:
> Hello WebTest-Com.
>
> I have a database-dbunit-query to get some kinds of webresults with =20=
> dbunit from our oracle-database.
> So the dbunit is a kind like xml:
>
> output from dbunit:
> <?xml version=3D'1.0' encoding=3D'UTF-8'?>
> <dataset>
> <FOO COL1=3D"22901862" COL2=3D"010100000084" COL3=3D"0" COL4=3D"RI" =20=
> COL5=3D"NP" COL6=3D"z" COL7=3D"03.10.2006"/>
> </dataset>
>
> How can I use these kinds of statements to get it through webtest =20
> like:
>
> invoke ...
> [...]
> <clickLink label=3D"${COL1}"/>
> <setInputField name=3D"number1" value=3D"${COL2}" .../>
> <clickButton .../>
> [..]
>
> and so on?
>
> How do I define it in ant/webtest as property-file or do I have to =20
> include it?
>
> Sorry, I found nothing about it in the web and the Mail-list.
> Thanks and kind regards.
>
> st germain
> ______________________________________________________________________=20=
> ____
> Erweitern Sie FreeMail zu einem noch leistungsst=E4rkeren E-Mail-=20
> Postfach! =09
> Mehr Infos unter http://freemail.web.de/home/landingpad/?mc=3D021131
>
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
--=20
The Laws of Computer Programming
* Finagle's Law *
In any collection of data, the figure the most obviously correct, =20
beyond all need of checking, is the mistake.