Monday, May 11, 2015

[SOAPUI] Generating an unique property per test case and referring it in multiple requests.


1) Create a SoapUI project and create a test case. 
2) Crete a Script test step and enter following code snippet. This should be the first test step of the test case. 

Node : this will create a property called id  in test case scope. So it won't get altered in multithreaded test.

Groovy Script

def key = java.util.UUID.randomUUID().toString()
context.getTestCase().getProperty( "id" ).setValue(key);



3) You can access property id in using following inline script. 

${=context.getTestCase().getPropertyValue( "id" )}

Example :






No comments:

Post a Comment