Eviware Forum

soapUI => soapUI => Topic started by: Manoj on January 18, 2008, 05:44:36 pm



Title: Adding Property names on Property Transfer by groovy
Post by: Manoj on January 18, 2008, 05:44:36 pm
Hi,

I am trying to add propety names to the property transfer step through groovy taking property names from a file . But failed. ???

Please help me on this. Below is the code...

// read the file
def properties = new java.util.Properties();
properties.load( new java.io.FileInputStream( "C:\\def.txt" ));
System.out.println("File was found........");
def targetStep = testRunner.testCase.getTestStepByName( "Property Transfer" );

//def names = properties.propertyNames();
def names = [];
names =  properties.propertyNames();

while( names.hasMoreElements() )
{
 def name = names.nextElement();
 
targetStep.addProperty( name ) ;

}



Title: Re: Adding Property names on Property Transfer by groovy
Post by: omatzura on January 19, 2008, 09:21:40 am
Hi!

shouldn't you be adding these to a "Properties" step? Property-Transfer steps don't support custom properties.. Or am I misunderstanding you?

regards!

/Ole
eviware.com


Title: Re: Adding Property names on Property Transfer by groovy
Post by: Manoj on January 21, 2008, 06:34:35 am
Hi,

I am able to add to the properties step. But could not able to add to Property transfer step.


Title: Re: Adding Property names on Property Transfer by groovy
Post by: omatzura on January 21, 2008, 10:10:37 am
Hi,

ok.. thats "ok".. you can't add properties to a property-transfer step. Maybe you want to add property-transfers dynamically?

regards,

/Ole
eviware.com


Title: Re: Adding Property names on Property Transfer by groovy
Post by: Manoj on January 21, 2008, 06:23:43 pm

Yes how can we add Property transefer dynamically?


Title: Re: Adding Property names on Property Transfer by groovy
Post by: omatzura on January 21, 2008, 11:19:29 pm
Hi!

you should call addTransfer ( name ) on the property-transfer step, this will create and return a new PropertyTransfer. The returned transfer then has properties for setting source/target/options, etc.. Have a look at the javadocs at http://www.soapui.org/apidocs/com/eviware/soapui/impl/wsdl/teststeps/PropertyTransfer.html

Hope this helps!

regards,

/Ole
eviware.com


Title: Re: Adding Property names on Property Transfer by groovy
Post by: Manoj on January 22, 2008, 06:58:13 am
Thank you.