8 messages in com.canoo.lists.webtestRE: [Webtest] Testdata| From | Sent On | Attachments |
|---|---|---|
| Torben Tretau | 21 Oct 2002 04:47 | |
| EPu...@upstate.com | 21 Oct 2002 06:01 | |
| Torben Tretau | 21 Oct 2002 06:25 | |
| Dierk Koenig | 21 Oct 2002 09:00 | |
| Torben Tretau | 22 Oct 2002 01:10 | |
| Dierk Koenig | 22 Oct 2002 01:43 | |
| Torben Tretau | 22 Oct 2002 04:55 | |
| Dierk Koenig | 22 Oct 2002 05:54 |
| Subject: | RE: [Webtest] Testdata![]() |
|---|---|
| From: | Torben Tretau (wt...@tretau.net) |
| Date: | 10/21/2002 06:25:27 AM |
| List: | com.canoo.lists.webtest |
Hi,
ok, that is good for testing persistence.. I mean with testdata that I have different settings of data that my web-application should be tested with. For example to test logins I could use a table with user_c@b, user_d@a with passwords and so on.. Testing the same fields with different test-data means writing test-steps for each of them..
Torben
The following message was sent by EPu...@upstate.com on Mon, 21 Oct 2002 09:01:41
-0400.
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="1exp...@test.com"/>
<verifytext stepid="Make sure we exported good data" text="3exp...@test.com"/>
<not stepid="make sure opted out people are not included"> <verifytext stepid="Make sure we have not exported opted out" text="2exp...@test.com"/> </not> </steps> </testSpec> </target>
exportEmailsToBrowser.xml file for DBUnit:
<dataset>
<EMAIL EMAIL_ID='1' EMAIL='1exp...@test.com' OPTIN='1'/> <EMAIL EMAIL_ID='2' EMAIL='2exp...@test.com' OPTIN='0'/> <EMAIL EMAIL_ID='3' EMAIL='3exp...@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: webt...@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 WebT...@lists.canoo.com http://lists.canoo.com/mailman/listinfo/webtest




