[Webtest] Step failure and ifStep

KLOPP Gerald webtest@lists.canoo.com
Mon, 16 Jan 2006 11:18:37 +0100


This is a multi-part message in MIME format.

------_=_NextPart_001_01C61A86.370CC1B0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi,
=20
I've already posted a message untitled 'click link only if it exists'
but I think the problem is more general.
Sometimes I want to execute a step and, if it fails, execute specific
other steps
=20
For example :
<verifyText text=3D"text to check">
<ifStep test=3D"haltonfail.property">
    <!-- Steps to execute if verifyText fails -->
</ifStep>
=20
Setting the 'haltonerror' and 'haltonfail' properties of the 'config'
task to false doesn't resolve the problem because the next step is never
executed.
In the example, if the verifyText fails, the ifStep is never reached.
=20
- One possible solution could be to refine the 'haltonfail' property and
to replace it with one like the following :
  property 'onfail' with the values :
    - 'nextWebTest' : processes the next web test if one step fails,
equivalent to haltonfail=3D'false',
    - 'nextStep' : processes the next step if one step fails
    - 'halt' : stops the build, equivalent to haltonfail=3D'true'
=20
- One other solution could be to modify the verifyXXX steps and have the
possibility to store the result of the step in a property instead of
halting
Example :
<verifyText failProperty=3D"fail"
            text=3D"text to check">
<ifStep test=3D"fail">
   <!-- Steps to execute if verifyText fails -->
</ifStep>
=20
- One other solution could be to modify the ifStep and have the
possibility to specify the test inside the target.
  The test is true if the task executed doesn't fail
Example :
<ifStep>
    <test>
        <verifyText text=3D"text to check">
    </test>
    <!-- Steps to execute if verifyText fails -->
</ifStep>
           =20
=20
What do you think?

------_=_NextPart_001_01C61A86.370CC1B0
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2800.1528" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D784501610-16012006>Hi,</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D784501610-16012006></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I've alrea</FONT><FONT face=3DArial =
size=3D2>dy posted=20
a message untitled 'click link only if it exists' but I think the =
problem is=20
more general.<BR>Sometimes I want to execute a step and, if it fails, =
execute=20
specific other steps</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>For example :<BR>&lt;verifyText =
text=3D"text to=20
check"&gt;<BR>&lt;ifStep =
test=3D"haltonfail.property"&gt;<BR>&nbsp;&nbsp;&nbsp;=20
&lt;!-- Steps to execute if verifyText fails=20
--&gt;<BR>&lt;/ifStep&gt;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Setting the 'haltonerror' and =
'haltonfail'=20
properties of the 'config' task to false doesn't resolve the problem =
because the=20
next step is never executed.<BR>In the example, if the verifyText fails, =
the=20
ifStep is never reached.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>- One possible solution could be to =
refine the=20
'haltonfail' property and to replace it with one like the following =
:<BR>&nbsp;=20
property 'onfail' with the values :<BR>&nbsp;&nbsp;&nbsp; - =
'nextWebTest' :=20
processes the next web test if one step fails, equivalent to=20
haltonfail=3D'false',<BR>&nbsp;&nbsp;&nbsp; - 'nextStep' : processes the =
next step=20
if one step fails<BR>&nbsp;&nbsp;&nbsp; - 'halt' : stops the build, =
equivalent=20
to haltonfail=3D'true'</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>- One other solution could be to modify =
the=20
verifyXXX steps and have the possibility to store the result of the step =
in a=20
property instead of halting<BR>Example :<BR>&lt;verifyText=20
failProperty=3D"fail"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;=20
text=3D"text to check"&gt;<BR>&lt;ifStep =
test=3D"fail"&gt;<BR>&nbsp;&nbsp; &lt;!--=20
Steps to execute if verifyText fails =
--&gt;<BR>&lt;/ifStep&gt;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>- One other solution could be to modify =
the ifStep=20
and have the possibility to specify the test inside the =
target.<BR>&nbsp; The=20
test is true if the task executed doesn't fail<BR>Example=20
:<BR>&lt;ifStep&gt;<BR>&nbsp;&nbsp;&nbsp;=20
&lt;test&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;verifyText=20
text=3D"text to check"&gt;<BR>&nbsp;&nbsp;&nbsp;=20
&lt;/test&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;!-- Steps to execute if =
verifyText fails=20
--&gt;<BR>&lt;/ifStep&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;=20
</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>What do you =
think?</FONT></DIV></BODY></HTML>

------_=_NextPart_001_01C61A86.370CC1B0--