Forum Discussion

mystiqu's avatar
mystiqu
New Contributor
15 years ago

Automatically invoke a groovy script for every test step

Hi

I´m pretty new to SoapUI, so there is probably a really easy solution to my problem.
I have bunch of web services which I have added to SoapUI (as test steps), and every service has a field which must contain a unique ID.

I´ve made a Groovy script which generates a unique ID, but how do I force SoapUI to call that script before every test step?
As it is now, I refer to the result from the latest invocation from the soap request, like this: ${GenerateUID#result}

This is what my test step sequence (and also load test) looks like:
1: [GenerateUID] (groovy script)
2: [ws 1]
3: [ws 2]
2: [ws 3]
...
N: [ws N]

This makes all the web services requests (1-n) use the same unique ID, until the next iteration.
How do I solve this without making a copy of the script and placing it between every test step?

Regards,
Mikael

2 Replies