[Webtest] Testdata
webtest@lists.canoo.com
webtest@lists.canoo.com
Mon, 21 Oct 2002 09:01:41 -0400
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C27901.FFB40030
Content-Type: text/plain;
charset="iso-8859-1"
I like to use DBUnit.. DBUnit has a series of Ant tasks that allow you to
update the database. This works very well if you have a "test" database
where you can delete/modify/insert data to your hearts contents.
Here is an example test.
Ant Script:
<target name="exportOptInEmailsToBrowser">
<dbunit
driver="${sql.jdbcdriver}"
url="${sql.url}"
userid="${sql.username}"
password="${sql.password}">
<operation type="MSSQL_REFRESH" src="data/exportEmailsToBrowser.xml"
format="flat"/>
</dbunit>
<testSpec name="exportOptInEmailsToBrowser">
&sharedConfiguration;
<steps>
&invokeHome;
<clickbutton stepid="Click link to Go To Export Email Addresses"
label="Export Email Addresses"/>
<verifytitle stepid="Make sure we are on the Export Page"
text="Export Email Addresses"/>
&verifyNoError;
<setinputfield stepid="set download type to browser window"
name="downloadtype"
value="1" />
<setinputfield stepid="set optin radio button"
name="exportType"
value="optin" />
<clickbutton stepid="Click link to Export Email Addresses"
label="Export Email Addresses"/>
<verifytext stepid="Make sure we have a title"
text="email id,email,optin"/>
<verifytext stepid="Make sure we exported good data"
text="1exportOptInEmailsToBrowser@test.com"/>
<verifytext stepid="Make sure we exported good data"
text="3exportOptInEmailsToBrowser@test.com"/>
<not stepid="make sure opted out people are not included">
<verifytext stepid="Make sure we have not exported opted out"
text="2exportOptInEmailsToBrowser@test.com"/>
</not>
</steps>
</testSpec>
</target>
exportEmailsToBrowser.xml file for DBUnit:
<dataset>
<EMAIL EMAIL_ID='1' EMAIL='1exportOptInEmailsToBrowser@test.com'
OPTIN='1'/>
<EMAIL EMAIL_ID='2' EMAIL='2exportOptInEmailsToBrowser@test.com'
OPTIN='0'/>
<EMAIL EMAIL_ID='3' EMAIL='3exportOptInEmailsToBrowser@test.com'
OPTIN='1'/>
</dataset>
This works well for Unit style tests with WebTest.. I only wish that I
could get my results into a format that JUnit could use. Or some sort of
wrapper JUnit testcase that would call Ant and put the results out in a more
Junit friendly format..
Eric
-----Original Message-----
From: Torben Tretau [mailto:wt@tretau.net]
Sent: Monday, October 21, 2002 7:47 AM
To: webtest@gate.canoo.com
Subject: [Webtest] Testdata
Hi,
got time to think about some features at the weekend.
I thought about how to use testdata and got into some
thoughts about to place the data into a database - and
link this data to my xml-description, clearlier: my settings
of input fields.. Could be an interesting feature in my
opinion..
Now my question: how does other people think about that,
how do they use testdata and do they think that the above
feature is useful?
RFC.. bye,
Torben
_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest
------_=_NextPart_001_01C27901.FFB40030
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2654.89">
<TITLE>RE: [Webtest] Testdata</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2>I like to use DBUnit.. DBUnit has a series of =
Ant tasks that allow you to update the database. This works very =
well if you have a "test" database where you can =
delete/modify/insert data to your hearts contents. </FONT></P>
<P><FONT SIZE=3D2>Here is an example test.</FONT>
</P>
<P><FONT SIZE=3D2>Ant Script:</FONT>
<BR><FONT SIZE=3D2><target =
name=3D"exportOptInEmailsToBrowser">  =
;  =
;  =
; </FONT>
<BR><FONT SIZE=3D2> <dbunit </FONT>
<BR><FONT SIZE=3D2> =
driver=3D"${sql.jdbcdriver}" &nbs=
p; </FONT>
<BR><FONT SIZE=3D2> =
url=3D"${sql.url}" &n=
bsp; </FONT>
<BR><FONT SIZE=3D2> =
userid=3D"${sql.username}" =
</FONT>
<BR><FONT SIZE=3D2> =
password=3D"${sql.password}"> </FONT>
<BR><FONT SIZE=3D2> =
<operation type=3D"MSSQL_REFRESH" =
src=3D"data/exportEmailsToBrowser.xml" =
format=3D"flat"/></FONT>
<BR><FONT SIZE=3D2> </dbunit></FONT>
<BR><FONT SIZE=3D2> </FONT>
<BR><FONT SIZE=3D2> <testSpec =
name=3D"exportOptInEmailsToBrowser"></FONT>
<BR><FONT SIZE=3D2> &sharedConfiguration;</FONT>
<BR><FONT SIZE=3D2> <steps></FONT>
<BR><FONT SIZE=3D2> =
&invokeHome;</FONT>
<BR><FONT SIZE=3D2> <clickbutton =
stepid=3D"Click link to Go To Export Email Addresses"</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; label=3D"Export Email =
Addresses"/> &nbs=
p; </FONT>
<BR><FONT SIZE=3D2> <verifytitle =
stepid=3D"Make sure we are on the Export Page"</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; text=3D"Export Email =
Addresses"/></FONT>
<BR><FONT SIZE=3D2> =
&verifyNoError;</FONT>
<BR><FONT SIZE=3D2> <setinputfield =
stepid=3D"set download type to browser window"</FONT>
<BR><FONT SIZE=3D2> =
name=3D"downloadtype"</FONT>
<BR><FONT SIZE=3D2> =
value=3D"1" =
/> &=
nbsp; </FONT>
<BR><FONT SIZE=3D2> <setinputfield =
stepid=3D"set optin radio button"</FONT>
<BR><FONT SIZE=3D2> =
name=3D"exportType"</FONT>
<BR><FONT SIZE=3D2> =
value=3D"optin" =
/> </FONT>
<BR><FONT SIZE=3D2> <clickbutton =
stepid=3D"Click link to Export Email Addresses"</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; label=3D"Export Email =
Addresses"/> &nbs=
p; </FONT>
<BR><FONT SIZE=3D2> <verifytext =
stepid=3D"Make sure we have a title"</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; text=3D"email =
id,email,optin"/>  =
;  =
; =
</FONT>
<BR><FONT SIZE=3D2> <verifytext =
stepid=3D"Make sure we exported good data"</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; =
text=3D"1exportOptInEmailsToBrowser@test.com"/> =
=
</FONT>
<BR><FONT SIZE=3D2> <verifytext =
stepid=3D"Make sure we exported good data"</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; =
text=3D"3exportOptInEmailsToBrowser@test.com"/> =
=
</FONT>
<BR><FONT SIZE=3D2> <not =
stepid=3D"make sure opted out people are not =
included"></FONT>
<BR><FONT SIZE=3D2> =
<verifytext stepid=3D"Make sure we have not exported opted =
out"</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; =
text=3D"2exportOptInEmailsToBrowser@test.com"/> =
</FONT>
<BR><FONT SIZE=3D2> </not></FONT>
<BR><FONT SIZE=3D2> </steps></FONT>
<BR><FONT SIZE=3D2> </testSpec> </FONT>
<BR><FONT SIZE=3D2></target></FONT>
</P>
<P><FONT SIZE=3D2>exportEmailsToBrowser.xml file for DBUnit:</FONT>
</P>
<BR>
<P><FONT SIZE=3D2><dataset></FONT>
</P>
<P><FONT SIZE=3D2> <EMAIL EMAIL_ID=3D'1' =
EMAIL=3D'1exportOptInEmailsToBrowser@test.com' OPTIN=3D'1'/></FONT>
<BR><FONT SIZE=3D2> <EMAIL EMAIL_ID=3D'2' =
EMAIL=3D'2exportOptInEmailsToBrowser@test.com' OPTIN=3D'0'/></FONT>
<BR><FONT SIZE=3D2> <EMAIL EMAIL_ID=3D'3' =
EMAIL=3D'3exportOptInEmailsToBrowser@test.com' OPTIN=3D'1'/></FONT>
<BR><FONT SIZE=3D2> </FONT>
<BR><FONT SIZE=3D2></dataset></FONT>
</P>
<P><FONT SIZE=3D2>This works well for Unit style tests with =
WebTest.. I only wish that I could get my results into a format =
that JUnit could use. Or some sort of wrapper JUnit testcase that =
would call Ant and put the results out in a more Junit friendly =
format..</FONT></P>
<P><FONT SIZE=3D2>Eric</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Torben Tretau [<A =
HREF=3D"mailto:wt@tretau.net">mailto:wt@tretau.net</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Monday, October 21, 2002 7:47 AM</FONT>
<BR><FONT SIZE=3D2>To: webtest@gate.canoo.com</FONT>
<BR><FONT SIZE=3D2>Subject: [Webtest] Testdata</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>Hi,</FONT>
</P>
<P><FONT SIZE=3D2>got time to think about some features at the =
weekend.</FONT>
<BR><FONT SIZE=3D2>I thought about how to use testdata and got into =
some</FONT>
<BR><FONT SIZE=3D2>thoughts about to place the data into a database - =
and</FONT>
<BR><FONT SIZE=3D2>link this data to my xml-description, clearlier: my =
settings</FONT>
<BR><FONT SIZE=3D2>of input fields.. Could be an interesting feature in =
my</FONT>
<BR><FONT SIZE=3D2>opinion..</FONT>
</P>
<P><FONT SIZE=3D2>Now my question: how does other people think about =
that,</FONT>
<BR><FONT SIZE=3D2>how do they use testdata and do they think that the =
above</FONT>
<BR><FONT SIZE=3D2>feature is useful?</FONT>
</P>
<P><FONT SIZE=3D2>RFC.. bye,</FONT>
<BR><FONT SIZE=3D2>Torben</FONT>
<BR><FONT SIZE=3D2>_______________________________________________</FONT=
>
<BR><FONT SIZE=3D2>WebTest mailing list</FONT>
<BR><FONT SIZE=3D2>WebTest@lists.canoo.com</FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://lists.canoo.com/mailman/listinfo/webtest" =
TARGET=3D"_blank">http://lists.canoo.com/mailman/listinfo/webtest</A></F=
ONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C27901.FFB40030--