[Webtest] Reading values from an XML File
Matt Raible
webtest@lists.canoo.com
Tue, 7 Oct 2003 16:45:05 -0600
Thanks Daniel - I got this to work, but how do I actually get each=20
Menu's attributes?
I'd like to loop through each menu and get it's name and page=20
attributes. The following gives me nothing:
<target name=3D"displayMenus">
<xmlproperty file=3D"${basedir}/defaultroot/WEB-INF/menu-config.xml"
keeproot=3D"false"/>
<echo message=3D"$Menus.Menu(name)"/>
<echo>$Menus.Menu(path)</echo>
</target>
Prints out:
displayMenus:
[echo] $Menus.Menu(name)
[echo] $Menus.Menu(path)
If I do ant -debug, I can see the properties are there - although=20
they're probably only good for the first menu found:
[xmlproperty] Menus.Menu(name):home
Setting project property: Menus.Menu(name) -> home
[xmlproperty] Menus.Menu(page):/
Setting project property: Menus.Menu(page) -> /=00
Actually, I'm sure they're only good for the first menu b/c I get the=20
following on the 2nd:
[xmlproperty] Menus.Menu(name):aboutOurTown
Override ignored for property Menus.Menu(name)=00
Thanks,
Matt
On Tuesday, October 7, 2003, at 07:13 AM, Daniel Potter wrote:
> I'm not a member of the WebTest mailing list so I can post a response=20=
> there.
> You should be able to gain access to the struts-menu url's by using=20
> the Ant
> XmlProperty task to pull in the url's as Ant properties that you can=20=
> then
> reference in your webtest steps.
>
> Daniel
>
>> I am using struts-menu (http://sf.net/projects/struts-menu) to drive=20=
>> many of
>> the URLs in my site. Would it be possible for webtest to read from=20=
>> it's
>> config file (menu-config.xml) to get URLs for testing pages? If not,=20=
>> can
>> anyone think of a way to make this happen? Basically, I'm trying to=20=
>> get out
>> of writing 100+ tests for each individual page.
>
>> Thanks,
>
>> Matt
>
>
> -------------------------------------------------
> This mail sent through IMP: http://horde.org/imp/