4 messages in com.canoo.lists.webtest[Webtest] Step failure and ifStep
FromSent OnAttachments
KLOPP Gerald16 Jan 2006 02:18 
Paul King16 Jan 2006 03:15 
KLOPP Gerald16 Jan 2006 06:04 
KLOPP Gerald19 Jan 2006 02:11.java, .java
Subject:[Webtest] Step failure and ifStep
From:KLOPP Gerald (gkl@europarl.eu.int)
Date:01/16/2006 02:18:14 AM
List:com.canoo.lists.webtest

Hi,

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

For example : <verifyText text="text to check"> <ifStep test="haltonfail.property"> <!-- Steps to execute if verifyText fails --> </ifStep>

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.

- 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='false', - 'nextStep' : processes the next step if one step fails - 'halt' : stops the build, equivalent to haltonfail='true'

- 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="fail" text="text to check"> <ifStep test="fail"> <!-- Steps to execute if verifyText fails --> </ifStep>

- 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="text to check"> </test> <!-- Steps to execute if verifyText fails --> </ifStep>

What do you think?