[Webtest] IfStatement doesn't work ...

Paul King webtest@lists.canoo.com
Wed, 01 Sep 2004 21:46:53 +1000


An error like this can occur if you have another ant task defined using 
"if" as the task name. Perhaps try changing the name of your step to 
"ifstep" in the webtest.properties file and then put <ifstep ...> in 
your test source. If this works, you probably have the ant-contrib defn 
also included in your build/ant environment. You can rename either step 
or remove the ant-contrib.

The only other cause I can think of would be if you have modified 
versions of some of the base webtest classes in your extension 
directory. Next time I compile a version I'll get rid of the .* imports 
and replace them with fully qualified class names. This might reduce the 
possibility of confusion.

Cheers, Paul.

Geoffroy Troles wrote:
> Hi ! 
> 
> I work with canoo build 483 and I can't use the custom step
> "Ifstatement" (v.480
> http://webtest-community.canoo.com/wiki/space/IfStatement).
> 
> Here is the test source: 
> 
> 
> <!DOCTYPE project SYSTEM "WebTest.dtd" [
> 	<!ENTITY config SYSTEM "modules/config.xml">
> 	<!ENTITY getHomePage SYSTEM "modules/getHomePage.xml">
> ]>
> <project name="if test" basedir="." default="local">
>   <target name="local">
>     <echo message="verify number of item in the basket"/>
>     <testSpec name="Just a test">
>       &config;
>       <steps>
>        &getHomePage;
>         <storexpath stepid="Check for debug statements"
> xpath="count(//td[1][@class='TinyTableColumnData']) > 6"
> property="NumberOfItems"/>
>         <if stepid="production tests" test="#{NumberOfItems}">
>           <clickbutton stepid="submit select handset button"
> name="select">
>             <form name="chooseHandset"/>
>           </clickbutton>
>         </if>
>       </steps>
>     </testSpec>
>   </target>
> </project>
> 
> 
> ant return the following error:
> 
> BUILD FAILED
> C:\P4source\depot\apps\swf\eshop\smoketests\testcases\testsuite.xml:135:
> Following error occured while executing this line
> C:\P4source\depot\apps\swf\eshop\smoketests\testcases\IfTest.xml:8: Task
> must be of type "Step": if at
> C:\P4source\depot\apps\swf\eshop\smoketests\testcases\IfTest.xml:13:  is
> of type com.canoo.webtest.extension.IfStep
> 
> 
> Does anyone can help me?