Forum Discussion

ITAbteilung's avatar
ITAbteilung
Contributor
14 years ago

[Resolved] Starting a testcase from a mockup

Hi there,

i am wondering if it is possible to start a testcase from a script of a SoapUI-Mockup-Service. The idea is adding asynchronous behavior to the Mockup-Service: the mockup gets the request, starts the testcase, sends back the (synchronous) response. Then the testcase is still running, waiting some seconds and sending a request to the client (from the Mockup-Service). Is this possible?

If not, what do you recommend for adding asynchronous behavior to a Mockup-Service? My idea would be to start a Thread that waits and sends the asynchronous Request (eg via URLConnection). Is there a more simple solution?

Thanks in advance,
best regards,
Patrick
  • Hello Ole,

    thanks for your quick reply. Calling a TestCase from the script now works fine (sorry, i must have overlooked that manualpage).

    But: the response of the Mockservice (that is calling the TestCase) comes AFTER the execution of the whole TestCase. I want the Mockservice to respond immediately (synchronous response), while the executed TestCase is still running and waiting (Delay) and then performing a HTTP-request (-> the asynchronous request).

    If that would work, I'd be perfectly happy!

    Thanks in advance,
    Pat
  • Hi Pat,

    the second argument to testCase.run is if it should run asynchronously - so if you set that to true the script should continue without waiting for the testCase to finish... the request you want to send after the testCase should then be sent by the testcase itself..

    does that make sense?

    regards,

    /Ole
    SmartBear Stockholm
  • Perfect, thanks!
    It was easy - I'm sorry, I really should have figured it out myself!

    Best regards!