[Webtest] passing parameters between two xml files

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


--0-1646716721-1221135246=:51540
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi Soula,
Thanks for replying.
I am not able to pass parameters within two Xml files.
So i tried converting groovy variable to ant and then pass.
But this is not working.
As per solution passing values from main script to temp script again
means passing variables between two xml files.
Please help me with the solution other than this conversion from groovy to =
ant and
passing the values.
Thanks in advance
Lavanya







--- On Thu, 11/9/08, Soula, William <wsoula@pointserve.com> wrote:
From: Soula, William <wsoula@pointserve.com>
Subject: RE: [Webtest] passing parameters between two xml files
To: "webtest@lists.canoo.com" <webtest@lists.canoo.com>
Date: Thursday, 11 September, 2008, 5:20 PM



=20
Could you output the property to a temp property file=20
and then read it in with the other script?



From: webtest-admin@lists.canoo.com=20
[mailto:webtest-admin@lists.canoo.com] On Behalf Of lavanya=20
palaniswamy
Sent: Thursday, September 11, 2008 6:25 AM
To:=20
webtest@lists.canoo.com
Subject: [Webtest] passing parameters between=20
two xml files




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

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

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

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

}
</scriptStep>


     =20
     =20

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

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

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




Did you know? You can CHAT without downloading messenger. Click=20
here=0A=0A=0A      Unlimited freedom, unlimited storage. Get it now, on htt=
p://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/
--0-1646716721-1221135246=:51540
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 Soula,<br>Thanks for replying.<br>I am not=
 able to pass parameters within two Xml files.<br>So i tried converting gro=
ovy variable to ant and then pass.<br>But this is not working.<br>As per so=
lution passing values from main script to temp script again<br>means passin=
g variables between two xml files.<br>Please help me with the solution othe=
r than this conversion from groovy to ant and<br>passing the values.<br>Tha=
nks in advance<br>Lavanya<br><br><br><br><br><br><br><br>--- On <b>Thu, 11/=
9/08, Soula, William <i>&lt;wsoula@pointserve.com&gt;</i></b> wrote:<br><bl=
ockquote style=3D"border-left: 2px solid rgb(16, 16, 255); margin-left: 5px=
; padding-left: 5px;">From: Soula, William &lt;wsoula@pointserve.com&gt;<br=
>Subject: RE: [Webtest] passing parameters between two xml files<br>To: "we=
btest@lists.canoo.com" &lt;webtest@lists.canoo.com&gt;<br>Date: Thursday, 1=
1
 September, 2008, 5:20 PM<br><br><div id=3D"yiv1328891058">

=20
<div dir=3D"ltr" align=3D"left"><font color=3D"#0000ff" face=3D"Arial" size=
=3D"2"><span class=3D"889434911-11092008">Could you output the property to =
a temp property file=20
and then read it in with the other script?</span></font></div><br>
<div class=3D"OutlookMessageHeader" dir=3D"ltr" align=3D"left" lang=3D"en-u=
s">
<hr tabindex=3D"-1">
<font face=3D"Tahoma" size=3D"2"><b>From:</b> webtest-admin@lists.canoo.com=
=20
[mailto:webtest-admin@lists.canoo.com] <b>On Behalf Of </b>lavanya=20
palaniswamy<br><b>Sent:</b> Thursday, September 11, 2008 6:25 AM<br><b>To:<=
/b>=20
webtest@lists.canoo.com<br><b>Subject:</b> [Webtest] passing parameters bet=
ween=20
two xml files<br></font><br></div>
<div></div>
<table border=3D"0" cellpadding=3D"0" cellspacing=3D"0">
  <tbody>
  <tr>
    <td valign=3D"top">Hi All,<br>Can any one help me in passing parameters=
=20
      between two<br>xml files.<br>With the following script(Script a1 is x=
ml=20
      file1 and Script b1 is xml file 2):<br><span style=3D"font-weight: bo=
ld;">Script a1:</span><br>&lt;target=20
      name=3D"main1"&gt;<br>&nbsp;&nbsp;&nbsp; &lt;webtest name=3D"a1"&gt;<=
br>&nbsp;=20
      <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
      &lt;steps&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br>&lt;scriptStep=20
      description=3D"to check alphabets"=20
      language=3D"groovy"&gt;<br>&nbsp;n1=3D"${n}";<br><br>&nbsp; p =3D=20
      n1.length()<br>&nbsp; <br>&nbsp;=20
      println("=3D=3D=3D=3D&gt;&gt;"+p);<br>if(p&gt;8)<br>&nbsp;{<br>printl=
n("invalid=20
      length")<br>}<br><br>else<br>{<br>println("one =3D=3D=20
      passed")<br>&nbsp;&nbsp;&nbsp; theRegularExpression =3D=20
      /([a-z])/<br><br>&nbsp; if (n1=20
      =3D~theRegularExpression)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
      &nbsp;<br>&nbsp; {<br>&nbsp; step.setWebtestProperty('a', n1);<br>&nb=
sp;=20
      }<br>&nbsp;else<br>&nbsp;{<br>println("one =3D=3D=20
      Failed");<br>}<br><br>}<br>&lt;/scriptStep&gt;<br><br>
      <hr style=3D"width: 100%; height: 2px;">
      <br><br><span style=3D"font-weight: bold;">Script b1:</span><br>&lt;p=
roject=20
      name=3D"SimpleTest" basedir=3D"." &gt;<br>&nbsp; &lt;property=20
      name=3D"webtest.home" location=3D"C:/Program Files/webtest" /&gt;<br>=
&nbsp;=20
      &lt;import file=3D"${webtest.home}/lib/taskdef.xml"/&gt;<br>&nbsp;&nb=
sp;=20
      &lt;ant antfile=3D"f1.xml" dir=3D"." inheritrefs=3D"true" target=3D"m=
ain"&gt;=20
      <br>&nbsp; &lt;property name=3D"webtest.connectioninitializer"=20
      value=3D"com.canoo.webtest.security.SunJsseBaseConnectionInitializer"=
=20
      /&gt;<br>&nbsp; &lt;property name=3D"webtest.truststore.file"=20
      value=3D"C:\Program Files\Java\jdk1.6.0_03\jre\lib\security\cacerts" =
/&gt;=20
      <br>&nbsp; &lt;property name=3D"webtest.truststore.passphrase"=20
      value=3D"changeit" /&gt;<br>&nbsp; <br>&nbsp;&nbsp; &nbsp;<br>&nbsp;&=
nbsp;=20
      &nbsp;&lt;property name=3D"n" value=3D"wwwww"/&gt;<br>&nbsp;&nbsp; &l=
t;!--=20
      &lt;property name=3D"a" value=3D"TEST2222"/&gt; --&gt;<br>&nbsp; &lt;=
/ant&gt;=20
      <br>&nbsp; &lt;target name=3D"main"&gt;<br>&nbsp;&nbsp;&nbsp; &lt;web=
test=20
      name=3D"b1"&gt;<br>&nbsp;&nbsp;&nbsp;=20
      &lt;config<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
      host=3D"ddddd.net"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
      protocol=3D"https"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
      &gt;<br>&nbsp;&nbsp;&nbsp; &lt;header name=3D"User-Agent"=20
      value=3D"Mozilla/4.0"/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;header=20
      name=3D"Accept-Language" value=3D"de-ch"/&gt;<br>&nbsp;&nbsp;=20
      &nbsp;<br>&nbsp;&nbsp;&nbsp; &lt;option name=3D"ThrowExceptionOnScrip=
tError"=20
      value=3D"false"/&gt;<br>&nbsp; &lt;option name=3D"JavaScriptEnabled"=
=20
      value=3D"true"/&gt;<br><br>&nbsp; &lt;/config&gt; <br>&nbsp;&nbsp;=20
      &lt;steps&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
      &lt;storeProperty<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
      description=3D"convert Ant to=20
      dynamic"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
      name=3D"a"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
      value=3D"${n}"/&gt;<br>&lt;setInputField name=3D"name.given"=20
      value=3D"#{a}"/&gt;<br>&lt;echo=20
      message=3D"#{a}"/&gt;<br>&lt;/steps&gt;<br>&nbsp;&nbsp;=20
      &lt;/webtest&gt;<br>&nbsp; &lt;/target&gt;<br>&lt;/project&gt;<br>
      <hr style=3D"width: 100%; height: 2px;">
      <br>Here am trying to call parameters from "a1" in to "b1"<br>script,=
by=20
      doing so,b1 is not getting executed.<br>Thanks in=20
      Advance<br>Lavanya<br><br></td></tr></tbody></table><br>
<hr size=3D"1">
Did you know? You can CHAT without downloading messenger. <a rel=3D"nofollo=
w" target=3D"_blank" href=3D"http://in.rd.yahoo.com/tagline_webmessenger_2/=
*http://in.webmessenger.yahoo.com/">Click=20
here</a></div></blockquote></td></tr></table><br>=0A=0A=0A=0A      <!--2-->=
<hr size=3D1></hr> Unlimited freedom, unlimited storage. <a href=3D"http://=
in.rd.yahoo.com/tagline_mail_2/*http://help.yahoo.com/l/in/yahoo/mail/yahoo=
mail/tools/tools-08.html/">Get it now</a>
--0-1646716721-1221135246=:51540--