[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..&nbsp; DBUnit has a series of =
Ant tasks that allow you to update the database.&nbsp; This works very =
well if you have a &quot;test&quot; database where you can =
delete/modify/insert data to your hearts contents.&nbsp; </FONT></P>

<P><FONT SIZE=3D2>Here is an example test.</FONT>
</P>

<P><FONT SIZE=3D2>Ant Script:</FONT>
<BR><FONT SIZE=3D2>&lt;target =
name=3D&quot;exportOptInEmailsToBrowser&quot;&gt;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&nbsp; &lt;dbunit </FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; =
driver=3D&quot;${sql.jdbcdriver}&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; =
url=3D&quot;${sql.url}&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; =
userid=3D&quot;${sql.username}&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; =
password=3D&quot;${sql.password}&quot;&gt;&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;operation type=3D&quot;MSSQL_REFRESH&quot; =
src=3D&quot;data/exportEmailsToBrowser.xml&quot; =
format=3D&quot;flat&quot;/&gt;</FONT>
<BR><FONT SIZE=3D2>&nbsp; &lt;/dbunit&gt;</FONT>
<BR><FONT SIZE=3D2>&nbsp; </FONT>
<BR><FONT SIZE=3D2>&nbsp; &lt;testSpec =
name=3D&quot;exportOptInEmailsToBrowser&quot;&gt;</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; &amp;sharedConfiguration;</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; &lt;steps&gt;</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&amp;invokeHome;</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;clickbutton =
stepid=3D&quot;Click link to Go To Export Email Addresses&quot;</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp; label=3D&quot;Export Email =
Addresses&quot;/&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p; </FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;verifytitle =
stepid=3D&quot;Make sure we are on the Export Page&quot;</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp; text=3D&quot;Export Email =
Addresses&quot;/&gt;</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&amp;verifyNoError;</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;setinputfield =
stepid=3D&quot;set download type to browser window&quot;</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
name=3D&quot;downloadtype&quot;</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
value=3D&quot;1&quot; =
/&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;setinputfield =
stepid=3D&quot;set optin radio button&quot;</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
name=3D&quot;exportType&quot;</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
value=3D&quot;optin&quot; =
/&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;clickbutton =
stepid=3D&quot;Click link to Export Email Addresses&quot;</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp; label=3D&quot;Export Email =
Addresses&quot;/&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p; </FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;verifytext =
stepid=3D&quot;Make sure we have a title&quot;</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp; text=3D&quot;email =
id,email,optin&quot;/&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;verifytext =
stepid=3D&quot;Make sure we exported good data&quot;</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp; =
text=3D&quot;1exportOptInEmailsToBrowser@test.com&quot;/&gt;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp; </FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;verifytext =
stepid=3D&quot;Make sure we exported good data&quot;</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp; =
text=3D&quot;3exportOptInEmailsToBrowser@test.com&quot;/&gt;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp; </FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;not =
stepid=3D&quot;make sure opted out people are not =
included&quot;&gt;</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;verifytext stepid=3D&quot;Make sure we have not exported opted =
out&quot;</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp; =
text=3D&quot;2exportOptInEmailsToBrowser@test.com&quot;/&gt;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/not&gt;</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; &lt;/steps&gt;</FONT>
<BR><FONT SIZE=3D2>&nbsp; &lt;/testSpec&gt;&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&lt;/target&gt;</FONT>
</P>

<P><FONT SIZE=3D2>exportEmailsToBrowser.xml file for DBUnit:</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>&lt;dataset&gt;</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp; &lt;EMAIL EMAIL_ID=3D'1' =
EMAIL=3D'1exportOptInEmailsToBrowser@test.com' OPTIN=3D'1'/&gt;</FONT>
<BR><FONT SIZE=3D2>&nbsp; &lt;EMAIL EMAIL_ID=3D'2' =
EMAIL=3D'2exportOptInEmailsToBrowser@test.com' OPTIN=3D'0'/&gt;</FONT>
<BR><FONT SIZE=3D2>&nbsp; &lt;EMAIL EMAIL_ID=3D'3' =
EMAIL=3D'3exportOptInEmailsToBrowser@test.com' OPTIN=3D'1'/&gt;</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&lt;/dataset&gt;</FONT>
</P>

<P><FONT SIZE=3D2>This works well for Unit style tests with =
WebTest..&nbsp; I only wish that I could get my results into a format =
that JUnit could use.&nbsp; 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--