File 1
<storeProperty property="stop" value="sending this email"/>
<echo file="debug.out" message="annoying=#{stop}"/>
File 2
<property file="debug.out"/>
<echo message="${annoying}"/>
If this doesn't help please do some research on your own about ant and property
files -> http://ant.apache.org/manual/CoreTasks/property.html
________________________________
From: lavanya palaniswamy [mailto:[EMAIL PROTECTED]
Sent: Friday, September 19, 2008 12:00 AM
To: [email protected]
Cc: Soula, William
Subject: RE: [Webtest] passing parameters between two xml files
---
Hi Soula,
Thanks for your reply.
I am not particular about groovy.
U can also explain me with javascript.
A1.xml(file1)
<scriptStep description="to check alphabets" language="javascript">
n1="Hello";
step.setWebtestProperty('a', n1);
</scriptStep>
<echo message="#{a}"/>
A2.xml (file2)
<project name="SimpleTest" basedir="." default="main4" >
<property name="webtest.home" location="C:/Program Files/webtest" />
<import file="${webtest.home}/lib/taskdef.xml"/>
<property name="webtest.connectioninitializer"
value="com.canoo.webtest.security.SunJsseBaseConnectionInitializer" />
<property name="webtest.truststore.file" value="C:\Program
Files\Java\jdk1.6.0_03\jre\lib\security\cacerts" />
<property name="webtest.truststore.passphrase" value="changeit" />
<import file="C:\Program Files\webtest\functions\A1.xml" description="Import
all functionalities for a full build"/>
<target name="main4" depends="main1">
<webtest name="c2">
<config
host="abc.net"
protocol="https"
>
<header name="User-Agent" value="Mozilla/4.0"/>
<header name="Accept-Language" value="de-ch"/>
<option name="ThrowExceptionOnScriptError" value="false"/>
<option name="JavaScriptEnabled" value="true"/>
</config>
<steps>
<echo message="#{a}"/>
</steps>
</webtest>
</target>
</project>
On executing File2, file 1(A1.xml) adn File 2(A2.xml)
gets executed seperately.No link between file 1 and File 2.So the result for
File 2 is
Output:
#{a}
instead of "Hello".
Please help me on how to pass values from one Xml file to another.
Thanks in Advance
Lavanya
--- On Thu, 11/9/08, Soula, William <[EMAIL PROTECTED]> wrote:
From: Soula, William <[EMAIL PROTECTED]>
Subject: RE: [Webtest] passing parameters between two xml files
To: "[email protected]" <[email protected]>
Date: Thursday, 11 September, 2008, 8:30 PM
I was thinking along the lines of this:
file 1:
<storeProperty property="movie" value="23"/>
<echo message="movie=#{movie}" file="output.txt"/>
file2:
<property file="output.txt"/>
<echo message="${movie}"/>
Something like that should be what you want, you could also use concat. If you
want to use groovy to output to the file you can do something like below (I
don't really know groovy, sorry :)
<script language="groovy">
println("movie=#{movie}")
</script>
________________________________
From: lavanya palaniswamy [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 11, 2008 7:14 AM
To: Soula, William
Cc: [email protected]
Subject: RE: [Webtest] passing parameters between two xml files
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 <[EMAIL PROTECTED]> wrote:
From: Soula, William <[EMAIL PROTECTED]>
Subject: RE: [Webtest] passing parameters between two xml files
To: "[email protected]" <[email protected]>
Date: Thursday, 11 September, 2008, 5:20 PM
Could you output the property to a temp property file and then read it in with
the other script?
________________________________
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of lavanya
palaniswamy
Sent: Thursday, September 11, 2008 6:25 AM
To: [email protected]
Subject: [Webtest] passing parameters between two xml files
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="main1">
<webtest name="a1">
<steps>
<scriptStep description="to check alphabets" language="groovy">
n1="${n}";
p = n1.length()
println("====>>"+p);
if(p>8)
{
println("invalid length")
}
else
{
println("one == passed")
theRegularExpression = /([a-z])/
if (n1 =~theRegularExpression)
{
step.setWebtestProperty('a', n1);
}
else
{
println("one == Failed");
}
}
</scriptStep>
________________________________
Script b1:
<project name="SimpleTest" basedir="." >
<property name="webtest.home" location="C:/Program Files/webtest" />
<import file="${webtest.home}/lib/taskdef.xml"/>
<ant antfile="f1.xml" dir="." inheritrefs="true" target="main">
<property name="webtest.connectioninitializer"
value="com.canoo.webtest.security.SunJsseBaseConnectionInitializer" />
<property name="webtest.truststore.file" value="C:\Program
Files\Java\jdk1.6.0_03\jre\lib\security\cacerts" />
<property name="webtest.truststore.passphrase" value="changeit" />
<property name="n" value="wwwww"/>
<!-- <property name="a" value="TEST2222"/> -->
</ant>
<target name="main">
<webtest name="b1">
<config
host="ddddd.net"
protocol="https"
>
<header name="User-Agent" value="Mozilla/4.0"/>
<header name="Accept-Language" value="de-ch"/>
<option name="ThrowExceptionOnScriptError" value="false"/>
<option name="JavaScriptEnabled" value="true"/>
</config>
<steps>
<storeProperty
description="convert Ant to dynamic"
name="a"
value="${n}"/>
<setInputField name="name.given" value="#{a}"/>
<echo message="#{a}"/>
</steps>
</webtest>
</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
________________________________
Did you know? You can CHAT without downloading messenger. Click
here<http://in.rd.yahoo.com/tagline_webmessenger_2/*http://in.webmessenger.yahoo.com/>
________________________________
Unlimited freedom, unlimited storage. Get it
now<http://in.rd.yahoo.com/tagline_mail_2/*http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/>
________________________________
Connect with friends all over the world. Get Yahoo! India
Messenger.<http://in.rd.yahoo.com/tagline_messenger_1/*http://in.messenger.yahoo.com/?wm=n/>
________________________________
Unlimited freedom, unlimited storage. Get it
now<http://in.rd.yahoo.com/tagline_mail_2/*http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/>
________________________________
________________________________
Unlimited freedom, unlimited storage. Get it
now<http://in.rd.yahoo.com/tagline_mail_2/*http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/>