I have been trying various ways to send a random value as part of payload of Rest testcase. I also need to assert that random value in the returned response.
I am able to add a random value to the payload. But I am not able to assert that random value in the response.
I have tried the following ways.
Add a groovy script and set a global variable.
def randomValue = java.util.UUID.randomUUID() com.eviware.soapui.SoapUI.globalProperties.setPropertyValue( "randomValue", randomValue )
Then use it in the payload as ${randomValue} This way I am able to access it in both request and assertion. This goes well with one request. When Load test is executed with lot of concurrent requests, the requests are having same value instead of random values.
Set property using Properties test step.
${=(int)(Math.random()*100)
This is proving a random value to the request. But in assertion the random value is new value. It is not the same as that in the request.
Any help is greatly appreciated.