Forum Discussion

JDT's avatar
17 years ago

Multiple property values to loop thru for same request

Hey! I'm writing some SoapUI tests and I want to have many property values put into my soap request and tested one after the other, from a file called basic.properties. I'd appreciate any input on how you do this, probably GroovyScript I think.
(I used the little snippet of Groovyscript from the tutorial page, but short of a .getProperties(name) feature, my script obviously won't help- plus how do you store multiple values in the file). Thanks!

def properties = new java.util.Properties();
properties.load( new java.io.FileInputStream("c:/root/SoapUI/trunk/basic.properties"));

def targetStep = testRunner.testCase.getTestStepByName("Basic Properties");

def names = properties.propertyNames();
while (names.hasMoreElements())
{
  def name = names.nextElement();
  // .getProperty unfortunately only returns one value of course...
  targetStep.setPropertyValue(name, properties.getProperty(name));
  log.info(properties.getProperty(name));
}

1 Reply

  • Hello,

    It sounds like what you're looking for is the DataSource loop available in the PRO version. Take a look here. Otherwise it is possible to do in Groovy as well, but providing support for this is outside the scope of our free support.

    Regards,
    Dain
    eviware support