If you use the following you can get lists of all the properties of
either sort.
 
Here are the Groovy code lines.
//
========================================================================
=
// Get the two types of properties set in Webtest.
//
========================================================================
=
def antProperties = step.getWebtestProperties( step.PROPERTY_TYPE_ANT )
;
def dynamicProperties = step.getWebtestProperties(
step.PROPERTY_TYPE_DYNAMIC ) ;
//
========================================================================
=

Pick the one that is not null. Or if you know which one it is, only
retrieve that one. My guess is that step.getWebtestProperty() only
retrieves the dynamic properties.

George

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Walton, Lynn
Sent: Thursday, March 27, 2008 12:44 PM
To: [EMAIL PROTECTED]; Chaohua Wang
Subject: RE: [Webtest] How to connect step.getWebtestProperty in groovy
with webbuild xml file?

I'm not an expert on this ... but I don't think the groovy step picks up
ant properties directly.  And you can't use the
step.setWebtestProperty(...) line in the xml. Isn't that throwing an
error? 

 What I do is store them in the xml before the groovy needs them with:

<storeProperty name="basehome.dir" value="${basehome.dir}"/>  

Try inserting that in your <steps> before the <groovy> step.

Lynn

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chaohua Wang
Sent: Thursday, March 27, 2008 2:30 PM
To: [email protected]
Subject: [Webtest] How to connect step.getWebtestProperty in groovy with
webbuild xml file?

Hi folks,

I have a test.groovy code, there is a line 

Def basedir = step.getWebtestProperty('basehome.dir').

In my buildtest.xml file
        
        <target name="test">
                <property name="basehome.dir" value="C:\test"/>
        <webtest name="test"> &config; <steps>
                step.setWebtestProperty('basehome.dir').                
                                
                                <groovy description=" test "
file="test.groovy"/>
                                

  </steps>
                </webtest>


My purpose is to retrieve path info from buildtest.xml in groovy code. 

But I println(basedir) is null, which means it doesn't get path info
from xml file. 
Please let me know how to solve this issue? Thank you

cwang


This message and any attachments are intended only for the use of the
addressee and may contain information that is privileged and
confidential. If the reader of the message is not the intended recipient
or an authorized representative of the intended recipient, you are
hereby notified that any dissemination of this communication is strictly
prohibited. If you have received this communication in error, please
notify us immediately by e-mail and delete the message and any
attachments from your system.
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to