[Webtest] iF statement patch

Ji Kim webtest@lists.canoo.com
Tue, 3 Aug 2004 11:43:55 -0700


I don't know if it's in the latest. (My guess is no but easy enough to
find out. src/com/canoo/extension/Ifstep.java. In some ways, I do agree
that conditional testing is not a good idea. But in reality, at least
for me, this has some use.) But I went through the same not finding the
examples. So, here it is.=20

The ant property var1 is set to true. (in property file: var1=3Dtrue or
<property name=3D"var1" value=3D"true"/> in the build file.)

             <iF
                stepid=3D"test ant property condition"
                test=3D"${var1}">
                <verifytext
                  stepid=3D"inside the 1st test condition"
                  text=3D"some conditional test text string or reg ex"
                />
             </iF>

The dynamic property var2 is set to true. (e.g. <storexpath
xpath=3D"count(//a) &gt; 0" property=3Dvar2/>)

             <iF
                stepid=3D"test dynamic property condition"
                test=3D"#{var2}">
                <clicklink
                  stepid=3D"inside the 2nd test condition"
                  label=3D"Here"
                />
             </iF>

Like <repeat>, you can have multiple steps between <iF> and </iF>.

-----Original Message-----
From: webtest-admin@gate2.canoo.com
[mailto:webtest-admin@gate2.canoo.com] On Behalf Of lisa.crispin@att.net
Sent: Tuesday, August 03, 2004 10:40 AM
To: webtest@gate2.canoo.com
Subject: [Webtest] iF statement patch


Is this patch integrated in the build now, or is it still only available
as a patch?

And is there an example anywhere of what the 'iF' looks like in the
actual WebTest script?  Jeannie said there was an example in her
posting, but I couldn't find it (doesn't mean it wasn't there, I might
just not get it).

Thanks,
Lisa


--- Jeannie Graham <Jgraham@arrowheadgrp.com> wrote:
> It looks like my stupid email blocker won't let me send zip files, so=20
> I am only sending the actual files (cuz they're small) but I can't=20
> send the html
> syntax file.   The iF statment has to look like this
> in your scripts, "iF" -
> small i, capital F.
>=20
>=20
> -----Original Message-----
> From: Jeannie Graham
> Sent: Wednesday, May 05, 2004 9:55 AM
> To: 'webtest@lists.canoo.com'
> Subject: [Webtest] If statement patch
>=20
>=20
> Hello everyone,
>=20
> 	Well, here it is!   I finally got the IF statement
> patch that Aatish
> sent to work (endless thanks to Aatish for making it
> possible!).   First, I
> had to make some tweaks to the files that Aatish sent me, IfStep.java=20
> and
> IfWrapper.java.   I also had to tweak
> TestStepSequence.java.
>=20
> Now, to add the patch and compile Canoo Webtest:
> 1).  Put both IfStep.java and IfWrapper.java into the WEBTESTHOME,=20
> extension directory.
> 2).  Update your TestStepSequence.java file, which is in the=20
> WEBTESTHOME,
> ant directory.  =20
> 3).  Update your webtestTaskdefs.props file, which is in the=20
> WEBTESTHOME directory, with "iF=3Dcom.canoo.webtest.extension.IfStep".
> 4).  Build the build file to compile the changes, C:\WEBTESTHOME>ant.
> 5).  Copy the new webtest.jar file in the deployment/lib directory to=20
> the main lib directory.
>=20
> And now, you should be able to do an iF statement. =20
> I am also including the
> html file that Aatish sent me, showing the syntax of the iF statement.
>=20
> Hope everyone enjoys,
> Jeannie
>  <<ATTACHMENT_OR_CONTENT_BLOCKING_ifpatch.zip.TXT>>
_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest