During the performance tests of the notification implementation in Petals, I needed to send
a large amount of ws requests containing a unique id. I couldn’t generate manually thousands
of requests (each one with its unique id) before launching my soapui test case.

The easiest way I found to solve it was to include a groovy script in my soapui test case:

1) Add a « properties » step in the test case, and define a property. These property will be modified by the groovy script to be different for each request.

prop

2) Add a groovy script in the test case, and write a script to modify your property. The value is generate using a timestamp, and the thread id, to be sure the id will be unique during the whole test, even with more than one thread launching the requests.

script groovy

3) In the requests of the test case, fill the correct element or attribute with ${property name}, which will be replaced at runtime by the property’s value.

request

4) All the requests of the test case have now the processPath attribute correctly set.

Mathias

2 réponses à “How to generate a unique id in soapui requests?”
  1. Good to know that the Groovy scripts feature is not only available on the response side when creating mocks. Thanks Mathias!

  2. petouls dit :

    Amazing, marvelous!
    It’s a crazy ass interesting matter and how powerfull groovy is!

Répondre