Forum Discussion
M_McDonald
14 years agoSuper Contributor
I am not sure what a data generator for states would do - return a state randomly? If you wanted that, you could put something like this in the Project Load script:
and wherever you wanted your random state in a Groovy script you could use
of as a property expansion
project.metaClass.static.getState = {
def states = ['AL','AZ','CA']
def rand = new java.util.Random()
return states[rand.nextInt(3)]
}and wherever you wanted your random state in a Groovy script you could use
def state = context.testCase.testSuite.project.getState()
of as a property expansion
${=context.testCase.testSuite.project.getState()}