[Webtest] Can do any judge in webtest?

Dierk Koenig webtest@lists.canoo.com
Wed, 13 Nov 2002 10:35:44 +0100


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: webtest-admin@lists.canoo.com
> [mailto:webtest-admin@lists.canoo.com]On Behalf Of Chen Gefei
> Sent: Mittwoch, 13. November 2002 4:07
> To: webtest@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
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>