3 messages in com.canoo.lists.webtestRE: [Webtest] Can do any judge in web...| From | Sent On | Attachments |
|---|---|---|
| Chen Gefei | 12 Nov 2002 19:06 | |
| Dierk Koenig | 13 Nov 2002 01:35 | |
| EPu...@upstate.com | 13 Nov 2002 07:33 |
| Subject: | RE: [Webtest] Can do any judge in webtest?![]() |
|---|---|
| From: | EPu...@upstate.com (EPu...@upstate.com) |
| Date: | 11/13/2002 07:33:42 AM |
| List: | com.canoo.lists.webtest |
I use either the ant <SQL> task or DBUnit to reset my database to a consistent state. I find that to be the only way to keep sane with all these various tests...
Here is an example:
<target name="exportOptOutEmailsToBrowser"> <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="exportOptOutEmailsToBrowser"> &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 optout radio button" name="exportType" value="optout" /> <clickbutton stepid="Click link to Export Email Addresses" label="Export Email Addresses"/> <verifytext stepid="Make sure we have not exported opted out" text="2exp...@test.com"/> <not stepid="make sure opted out people are not included"> <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> </steps> </testSpec> </target>
The dbunit just resets everything, and then loads my data.
Eric Pugh
-----Original Message----- From: Dierk Koenig [mailto:dier...@canoo.com] Sent: Wednesday, November 13, 2002 4:36 AM To: webt...@lists.canoo.com Subject: RE: [Webtest] Can do any judge in webtest?
Hi Chen,
If exist , delete it , if not creat a user.
I'm not sure about the logic here...
Let's tackle it one-by-one:
If exist , delete it
<steps> <!-- invoke page that displays the user --> <invoke .../> <!-- verify user is displayed, stop otherwise --> <verify.../> <!-- delete the user --> <clicklink .../> </steps>
if not create a user.
<steps> <!-- invoke page that displays the user --> <invoke .../> <!-- verify user is not displayed, stop otherwise --> <not> <verify.../> </not> <!-- create the user --> <clicklink .../> </steps>
Although all the above is possible, I guess you are looking for something different: a consistent state before starting the tests. I could not see, whether you expect no user or one user for test setup (your logic actually "toggles" that state). However, you can use the strategies above for test setup through the web interface or for a trailing cleanup. Make sure to have the <steps> contained in a separate <testSpec>. Whenever there is a database involved, it may be profitable to care for test setup by calling the db directly from preceding ant target. You may scan the mailing list archive for e.g. use of dbunit for that purpose.
cheers Mittie
-----Original Message----- From: webt...@lists.canoo.com [mailto:webt...@lists.canoo.com]On Behalf Of Chen Gefei Sent: Mittwoch, 13. November 2002 4:07 To: webt...@lists.canoo.com Subject: [Webtest] Can do any judge in webtest?
hi all
I want to delete some user in an application , and first i want to know whether the user existed or not . If exist , delete it , if not creat a user.
Can i complete those acton through webtest ? or by ant ?
Thank you all
_________________________________________________________________ 免费下载 MSN Explorer: http://explorer.msn.com/lccn/
_______________________________________________ WebTest mailing list WebT...@lists.canoo.com http://lists.canoo.com/mailman/listinfo/webtest
_______________________________________________ WebTest mailing list WebT...@lists.canoo.com http://lists.canoo.com/mailman/listinfo/webtest




