Hi,
you have to use the syntax @{count} to access macro attribute value
http://ant.apache.org/manual/CoreTasks/macrodef.html
Btw: you should probably used >> instead of >>
Marc.
Mark McKeown wrote:
>
> Guys,
>
> I have a macrodef:
>
> <macrodef name="verifyMacro">
> <attribute name="count" default="0"/>
> <attribute name="breadcrumb1" default="X"/>
> <attribute name="breadcrumb2" default="X"/>
> <attribute name="breadcrumb3" default="X"/>
> <attribute name="breadcrumb4" default="X"/>
>
> <sequential>
>
> <ifStep description="breadcrumb has 3 values">
> <condition>
> <verifyProperty name="count" value="3"/>
> </condition>
> <verifyXPath description="Check breadcrumbs"
> xpath="//[EMAIL PROTECTED]'breadcrumbs']"
> text="${breadcrumb1} >> ${breadcrumb2} >> ${breadcrumb3}"/>
> </ifStep>
>
> <ifStep description="breadcrumb has 4 values">
> <condition>
> <verifyProperty name="count" value="0"/>
> </condition>
> <verifyXPath description="Check breadcrumbs"
> xpath="//[EMAIL PROTECTED]'breadcrumbs']"
> text="${breadcrumb1} >> ${breadcrumb2} >> ${breadcrumb3} >>
> ${breadcrumb4}"/>
> </ifStep>
>
> </sequential>
>
> </macrodef>
>
>
> and I call it using:
>
>
> <verifyMacro
> count="3"
> breadcrumb1="${menu1}"
> breadcrumb2="${menu2}"
> breadcrumb3="${menu3}"
> breadcrumb4=""/>
>
> The purpose of my macrodef is to check the breadcrumbs in my page. If I
> set count="3" then I have 3 values in my
> breadcrumbs and I expect the <condition> in my first <ifStep> to be true
> and execute the step to verify the 3 values in
> my breadcrumbs. However the <condition> in my <ifStep> does not appear to
> be tested?? I think this is because "count" is
> probably not a "property" as such.
>
> Can anyone suggest a way that I can test what value "count" is set to and
> thus execute the correct part of my macrodef?
>
> Thanks in adavance,
> Mark
> _______________________________________________
> WebTest mailing list
> [email protected]
> http://lists.canoo.com/mailman/listinfo/webtest
>
>
--
View this message in context:
http://www.nabble.com/macrodef-tf2945794.html#a8239316
Sent from the WebTest mailing list archive at Nabble.com.
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest