|
Title: Running testStep in groovy script Post by: Bram Baptiste on February 20, 2008, 07:10:08 pm Hi,
I want to do 50 times a testStep with different parameters in a loop. I think the best way to do this is in a groovy script. the teststep is createTerminal. But in the loop the mac address of the createTerminal has to change. Is this feasible? And if yes, can somebody guide me the way? Tia, Bram Title: Re: Running testStep in groovy script Post by: omatzura on February 21, 2008, 12:58:13 am Hi!
This sounds like a candidate requirement for the DataSource related functionality in soapUI Pro. Are you? If you are not using soapUI Pro, then groovy scripts will do the trick as well (a bit more work though..). Have a look at the template-data data scenario to get the idea: http://www.soapui.org/userguide/scenarios/templatedriven.html Hope this helps! regards, /Ole eviware.com Title: Re: Running testStep in groovy script Post by: darshan on July 31, 2008, 09:08:21 pm 1) Set the Property in the property file.
2) Next write a Property Transfer from the property to the request. 3) After this write a groovy script to to read from the Property file and change the property. This can be done as follows: def request = testRunner.testCase.getTestStepByName( "activateRequest" ); def property = request.getProperty( "request" ); //get the property value from the Property file def props = testRunner.testCase.getTestStepByName("Properties"); String sNo = props.getPropertyValue("sNo"); Here sNo is the name of the property set. 4)Use XPATH to navigate the XML file. use this command..its powerful.. //sNo/text() |