porcupineRabbit
5 years agoOccasional Contributor
Data Generator - Change "duplicate each value" property through Groovy
Hello all,
I have used a DataSource with DataGenerator type selected, in one of my test cases and I'm trying to set the "duplicate each value" property through a Groovy step. What I'm trying to achieve here is to set this value from a project-level custom property. The test case is setup as shown below and I have managed to go as far as this in my Groovy step:
def valueRepetition = context.expand('${#Project#repeatValue}')
def objDsStep = context.testCase.testSteps["Data Generator"]
// objDsStep is a com.eviware.soapui.impl.wsdl.teststeps.WsdlDataSourceTestStep
def objSource = objDsStep.getDataSource()
// objSource is a com.eviware.soapui.impl.wsdl.teststeps.datasource.DataGenerator.UI.DataGeneratorDataSource object
log.info(objSource.toString())
I've looked through the API documentation but I cannot find which method to call in order to retrieve the generator's properties and update the 'repetitionCount' method .
Can anyone provide some help on this?
Thanks in advance!