[Webtest] passing parameters between two xml files

lavanya palaniswamy lavan.swamy@yahoo.co.in
Thu, 11 Sep 2008 16:54:44 +0530 (IST)


--0-1008440535-1221132284=:97775
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi All,
Can any one help me in passing parameters between two
xml files.
With the following script(Script a1 is xml file1 and Script b1 is xml file =
2):
Script a1:
<target name=3D"main1">
=C2=A0=C2=A0=C2=A0 <webtest name=3D"a1">
=C2=A0=20
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <steps>
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0
<scriptStep description=3D"to check alphabets" language=3D"groovy">
=C2=A0n1=3D"${n}";

=C2=A0 p =3D n1.length()
=C2=A0=20
=C2=A0 println("=3D=3D=3D=3D>>"+p);
if(p>8)
=C2=A0{
println("invalid length")
}

else
{
println("one =3D=3D passed")
=C2=A0=C2=A0=C2=A0 theRegularExpression =3D /([a-z])/

=C2=A0 if (n1 =3D~theRegularExpression)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0
=C2=A0 {
=C2=A0 step.setWebtestProperty('a', n1);
=C2=A0 }
=C2=A0else
=C2=A0{
println("one =3D=3D Failed");
}

}
</scriptStep>



Script b1:
<project name=3D"SimpleTest" basedir=3D"." >
=C2=A0 <property name=3D"webtest.home" location=3D"C:/Program Files/webtest=
" />
=C2=A0 <import file=3D"${webtest.home}/lib/taskdef.xml"/>
=C2=A0=C2=A0 <ant antfile=3D"f1.xml" dir=3D"." inheritrefs=3D"true" target=
=3D"main">=20
=C2=A0 <property name=3D"webtest.connectioninitializer" value=3D"com.canoo.=
webtest.security.SunJsseBaseConnectionInitializer" />
=C2=A0 <property name=3D"webtest.truststore.file" value=3D"C:\Program Files=
\Java\jdk1.6.0_03\jre\lib\security\cacerts" />=20
=C2=A0 <property name=3D"webtest.truststore.passphrase" value=3D"changeit" =
/>
=C2=A0=20
=C2=A0=C2=A0 =C2=A0
=C2=A0=C2=A0 =C2=A0<property name=3D"n" value=3D"wwwww"/>
=C2=A0=C2=A0 <!-- <property name=3D"a" value=3D"TEST2222"/> -->
=C2=A0 </ant>=20
=C2=A0 <target name=3D"main">
=C2=A0=C2=A0=C2=A0 <webtest name=3D"b1">
=C2=A0=C2=A0=C2=A0 <config
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 host=3D"ddddd.net"
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 protocol=3D"https"
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 >
=C2=A0=C2=A0=C2=A0 <header name=3D"User-Agent" value=3D"Mozilla/4.0"/>
=C2=A0=C2=A0=C2=A0 <header name=3D"Accept-Language" value=3D"de-ch"/>
=C2=A0=C2=A0 =C2=A0
=C2=A0=C2=A0=C2=A0 <option name=3D"ThrowExceptionOnScriptError" value=3D"fa=
lse"/>
=C2=A0 <option name=3D"JavaScriptEnabled" value=3D"true"/>

=C2=A0 </config>=20
=C2=A0=C2=A0 <steps>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <storeProperty
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 description=3D"convert Ant to dy=
namic"
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 name=3D"a"
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 value=3D"${n}"/>
<setInputField name=3D"name.given" value=3D"#{a}"/>
<echo message=3D"#{a}"/>
</steps>
=C2=A0=C2=A0 </webtest>
=C2=A0 </target>
</project>

Here am trying to call parameters from "a1" in to "b1"
script,by doing so,b1 is not getting executed.
Thanks in Advance
Lavanya

=0A=0A=0A      Connect with friends all over the world. Get Yahoo! India Me=
ssenger at http://in.messenger.yahoo.com/?wm=3Dn/
--0-1008440535-1221132284=:97775
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<table cellspacing=3D"0" cellpadding=3D"0" border=3D"0" ><tr><td valign=3D"=
top" style=3D"font: inherit;">Hi All,<br>Can any one help me in passing par=
ameters between two<br>xml files.<br>With the following script(Script a1 is=
 xml file1 and Script b1 is xml file 2):<br><span style=3D"font-weight: bol=
d;">Script a1:</span><br>&lt;target name=3D"main1"&gt;<br>&nbsp;&nbsp;&nbsp=
; &lt;webtest name=3D"a1"&gt;<br>&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;steps&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br>&lt;scriptStep descript=
ion=3D"to check alphabets" language=3D"groovy"&gt;<br>&nbsp;n1=3D"${n}";<br=
><br>&nbsp; p =3D n1.length()<br>&nbsp; <br>&nbsp; println("=3D=3D=3D=3D&gt=
;&gt;"+p);<br>if(p&gt;8)<br>&nbsp;{<br>println("invalid length")<br>}<br><b=
r>else<br>{<br>println("one =3D=3D passed")<br>&nbsp;&nbsp;&nbsp; theRegula=
rExpression =3D /([a-z])/<br><br>&nbsp; if (n1 =3D~theRegularExpression)<br=
>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br>&nbsp; {<br>&nbsp; step.set=
WebtestProperty('a',
 n1);<br>&nbsp; }<br>&nbsp;else<br>&nbsp;{<br>println("one =3D=3D Failed");=
<br>}<br><br>}<br>&lt;/scriptStep&gt;<br><br><hr style=3D"width: 100%; heig=
ht: 2px;"><br><br><span style=3D"font-weight: bold;">Script b1:</span><br>&=
lt;project name=3D"SimpleTest" basedir=3D"." &gt;<br>&nbsp; &lt;property na=
me=3D"webtest.home" location=3D"C:/Program Files/webtest" /&gt;<br>&nbsp; &=
lt;import file=3D"${webtest.home}/lib/taskdef.xml"/&gt;<br>&nbsp;&nbsp; &lt=
;ant antfile=3D"f1.xml" dir=3D"." inheritrefs=3D"true" target=3D"main"&gt; =
<br>&nbsp; &lt;property name=3D"webtest.connectioninitializer" value=3D"com=
.canoo.webtest.security.SunJsseBaseConnectionInitializer" /&gt;<br>&nbsp; &=
lt;property name=3D"webtest.truststore.file" value=3D"C:\Program Files\Java=
\jdk1.6.0_03\jre\lib\security\cacerts" /&gt; <br>&nbsp; &lt;property name=
=3D"webtest.truststore.passphrase" value=3D"changeit" /&gt;<br>&nbsp; <br>&=
nbsp;&nbsp; &nbsp;<br>&nbsp;&nbsp; &nbsp;&lt;property name=3D"n" value=3D"w=
wwww"/&gt;<br>&nbsp;&nbsp; &lt;!--
 &lt;property name=3D"a" value=3D"TEST2222"/&gt; --&gt;<br>&nbsp; &lt;/ant&=
gt; <br>&nbsp; &lt;target name=3D"main"&gt;<br>&nbsp;&nbsp;&nbsp; &lt;webte=
st name=3D"b1"&gt;<br>&nbsp;&nbsp;&nbsp; &lt;config<br>&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp; host=3D"ddddd.net"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp; protocol=3D"https"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&nbsp;&nbsp;&nbsp; &lt=
;header name=3D"User-Agent" value=3D"Mozilla/4.0"/&gt;<br>&nbsp;&nbsp;&nbsp=
; &lt;header name=3D"Accept-Language" value=3D"de-ch"/&gt;<br>&nbsp;&nbsp; =
&nbsp;<br>&nbsp;&nbsp;&nbsp; &lt;option name=3D"ThrowExceptionOnScriptError=
" value=3D"false"/&gt;<br>&nbsp; &lt;option name=3D"JavaScriptEnabled" valu=
e=3D"true"/&gt;<br><br>&nbsp; &lt;/config&gt; <br>&nbsp;&nbsp; &lt;steps&gt=
;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;storeProperty<br>&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp; description=3D"convert Ant to
 dynamic"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name=3D"a"<br>&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; value=3D"${n}"/&gt;<br>&lt;setInputFi=
eld name=3D"name.given" value=3D"#{a}"/&gt;<br>&lt;echo message=3D"#{a}"/&g=
t;<br>&lt;/steps&gt;<br>&nbsp;&nbsp; &lt;/webtest&gt;<br>&nbsp; &lt;/target=
&gt;<br>&lt;/project&gt;<br><hr style=3D"width: 100%; height: 2px;"><br>Her=
e am trying to call parameters from "a1" in to "b1"<br>script,by doing so,b=
1 is not getting executed.<br>Thanks in Advance<br>Lavanya<br><br></td></tr=
></table><br>=0A=0A=0A      <!--2--><hr size=3D1></hr> Did you know? You ca=
n CHAT without downloading messenger. <a href=3D"http://in.rd.yahoo.com/tag=
line_webmessenger_2/*http://in.webmessenger.yahoo.com/"> Click here</a>
--0-1008440535-1221132284=:97775--