Forum Discussion

jpr's avatar
jpr
Occasional Contributor
15 years ago

MockResponse step invoke multiple times

Hi,

I have a soapUI test case where a MockResponse teststep should be invoked multiple times (5x). I want to assert that a certain field in the received mock requests is 'X' for the first 4 invocations, and 'Y' for the 5th invocation.

But I can't seem to figure out how to do this.

If I add a groovy script assertion it is apparently only invoked for the first mock request?

1 Reply

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi jpr,


    A quick'n'dirty way to achieve this is to simply create 5 successive requests to your MockResponse and create assertions for each request: four of them expecting 'X', and the fifth one expecting 'Y'.
    Before running this test case you would need to run the MockService which encompasses your MockResponse, of couse.

    That should do the trick. Please let us know if it did.


    Cheers!
    /Nenad Nikolic a.k.a. Shonzilla