Unique ID (2) – Sequence

This is more involved, where Unique ID (1) is based on a simply code
Secondly – this ONLY works if you’re the

    sole user

of SoapUI since it will have to be saved after use

1. Add a property test step
2. Add three Names:
a. nextVal (This is the result you’ll point to)
b. Intgr (This is the # you want to add to the previous
c. seq (This has to be there to record the previous value which will == nextVal all the time)
d. Set each value to 1

def nextVal = context.expand( '${Properties#nextVal}' ) as int
def Intgr = context.expand( '${Properties#Intgr}' ) as int
def seq = context.expand( '${Properties#seq}' ) as int

String nv = Intgr + nextVal
testRunner.testCase.getTestStepByName( "Properties" )setPropertyValue( "nextVal", nv )
String ep = Intgr + nextVal
testRunner.testCase.getTestStepByName( "Properties" )setPropertyValue( "seq", ep )

Notes: If you run the script with the Property step open you’ll see the value change by 1 each time. If you set Intgr to 2, then the value will increase by 2 etc..