Forum Discussion

AndiKoll's avatar
AndiKoll
Contributor
14 years ago

awaiting several asynchronuos requests

Hi,

I try to realize a test case for the following use case:
After receiving a request and respondign it the interface awaites several different requests without knowing which request comes first.
How can I realize:
- responding the initial request (by using test step 'Mock response')
- waiting for any request receiving
- checking which request has been received
- waiting a defined time for a second and third request (any request of the WSDL definition)
- raising an asertion in case of timeout

Is there any e3xample available?
CXan you give me any hint how to solve the problem?

Thanks in advance
Greetings
Andi Kollenbach

4 Replies

  • Hello!

    Awaiting multiple non-ordered requests is currently not possible (easily).

    What you could do is using a DataGen-loop and then use MockResponse TestStep with a Script Assertion (containing multiple logical assertions that are OR-ed together). This will get a little bit easier in soapUI 4.5.

    The above workaround requires that you know Groovy Scripting quite well.

    Regards

    Henrik
    SmartBear Software
  • Thanks for the answer.
    I'm testing the following workaround:
    creating a test case waiting for the initial SOAP request.
    creating some more test cases awaiting and handling the unordered SOAP requests expected.
    When the initial request occures a script test step calls the other test cases asynchronuously.

    I'm not quite shure whether this workaround works.
    Any idea?

    Greetings
    Andi
  • Neat idea! I don't see any reason why that shouldn't work.

    Good luck!

    Henrik
    SmartBear Software
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    What about just having the 3 test cases in one test suite and running them in parallel from the test suite panel? If you set their timeouts, a failure of a test case will indicate a timeout for that response.