[Webtest] Accessing a variable created in a previous project
Michael Knapp
webtest@lists.canoo.com
Mon, 27 Mar 2006 14:10:15 -0800
Paul, I'm a bit of a newb....
In making the separate targets, do I do so outside of the target they
are currently in, or can they be nested?
Also, should I replace the current antWrapper with the antcall i.e., in
the same place the antWrapper steps are currently?
It also occurred to me that using a script block (like a <groovy> step)
might be the way to go, but the groovy examples I've found have been
fairly inpenetrable....
=20
Thanks
mike
> Hi Mike, try putting your Session1 exec statements into their=20
> own ant target and use an antcall instead of the current antWrapper.
> The antWrapper step doesn't expand #{} within tasks like exec=20
> which aren't steps at the moment. I think you are observing=20
> ant's early binding "feature" which is binding the ${}=20
> variables to values at the beginning of the task. You won't=20
> need an antWrapper in Session2 either.
>=20
> Cheers, Paul.
> > Session1:
> > <storeRegEx
> > description=3D"Remember registry number"
> > text=3D"gl[0-9]+[a-z]?"
> > group=3D"0"
> > property=3D"regNumber"=20
> > />
> > <storeProperty
> > description=3D"convert prop type "
> > name=3D"registryNumber"
> > value=3D"#{regNumber}"=20
> > propertyType=3D"ant"/>
> > <antWrapper>
> > <exec executable=3D"touch"> <arg
> >=20
> value=3D"tmp/${registry.accessLevel}.lastName.${registrantLastNa
> me.value}"
> > /></exec>
> > <exec executable=3D"touch"> <arg
> > value=3D"tmp/${registry.accessLevel}.regNumber.${registryNumber}"
> > /></exec>
> > </antWrapper>
> >=20
> > Session2 (separate project):
> > <antWrapper>
> > <exec executable=3D"ls" outputproperty=3D"lastName"><arg=20
> > value=3D"tmp/protected.lastName.*"/> </exec> <exec executable=3D"ls" =
> > outputproperty=3D"regNumber"><arg =
value=3D"tmp/protected.regNumber.*"/>=20
> > </exec> <echo message=3D"last name is ${lastName}"/> </antWrapper>