In SoapUI (Pro version) I have 12 test steps:
-
GET
request - Groovy script witch get
total
value from response from the previous step - Properties
- Properties transfer
-
POST
request 1 -
POST
request 2 -
POST
request 3 -
POST
request 4 -
POST
request 5 -
POST
request 6 -
POST
request 7 -
POST
request 8
All POST
requests have ID
parameters.
Question:
How to write a Groovy script like this or maybe another decision way:
if total = 8 then set ID parameters of POST 1 = 1,POST 2 = 1,POST 3 = 1,POST 4 = 1,POST 5 = 1,POST 6 = 1,POST 7 = 1,POST 8 = 1
if total = 7 then set ID parameters of POST 1 = 2,POST 2 = 1,POST 3 = 1,POST 4 = 1,POST 5 = 1,POST 6 = 1,POST 7 = 1
if total = 6 then set ID parameters of POST 1 = 2,POST 2 = 2,POST 3 = 1,POST 4 = 1,POST 5 = 1,POST 6 = 1
if total = 5 then set ID parameters of POST 1 = 2,POST 2 = 2,POST 3 = 2,POST 4 = 1,POST 5 = 1
if total = 4 then set ID parameters of POST 1 = 2,POST 2 = 2,POST 3 = 2,POST 4 = 2
if total = 3 then set ID parameters of POST 1 = 3,POST 2 = 3,POST 3 = 2
if total = 2 then set ID parameters of POST 1 = 4,POST 2 = 4
if total = 1 then set ID parameters of POST 1 = 8