Forum Discussion

abers29's avatar
abers29
Occasional Contributor
15 years ago

Using SOAPUI as client and server inside the same test

Hi,

I'm using SOAPUI Pro 3.5.1 in a specific context :

- different steps are linked inside a same test case suit

- first of them send request to API server (example : login function, notification subscribing) :
in that situation, SOAPUI tool is bearing itself as a client

- for next step, a notification is expected from API : then, SOAPUI tool is bearing itself as a server ;
to operate this step, I created a Mockservice inside concerned step (step "notification is waiting" in

following example)

example : steps for test to run
- login request (SOAPUI as client)
- subcribe request (SOAPUI as client)
- notification is waiting (SOAPUI as server)

- But I meet a problem when running because Mockservice is started just when arriving to "notification"

step ;
at this time, API server may have already sent expected notification but can't be catch by Mockservice

which was
not started again !

does any way exist to resolv this problem ?

thank you for you help

8 Replies

  • Hi!

    the MockResponse TestStep has a "Start Step" property (in the bottom left table of properties) with which you can set when it should start listening, please try setting that to the request step before it to be sure it is listening when the request comes in.

    Does that help?

    regards!

    /Ole
    eviware.com
  • abers29's avatar
    abers29
    Occasional Contributor
    Hi,

    Thank you for your help.
    I set "start Step" field of MockResponse as suggested.
    But test is stopped with failed error on MockResponse step.

    In fact, jetty log is displayed "Unknown source" for several events (as EventDispatch)
    Perhaps a configuration problem for response (bad listening) !

    Have you got an idea, please ?

    abers29
  • Hi!

    hm... how have you configured the mockresponse teststep? can you attach your project?

    regards!

    /Ole
    eviware.com
  • abers29's avatar
    abers29
    Occasional Contributor
    Hi,

    I didnt know how docroot file could be configured.
    By going on SOAPUI forum, I found following information :

    the folder specified will be used as a root folder for returning files from the file-system, so if you put a file in the c:\SoapUIResponses folder named "test.html" and then call your mockservice with a GET request to http://localhost://test.html it should return the test.html file.

    Then, I changed url MOCK response in : http://172.25.185.50:8089/SoapUIResponses/test.html
    Before that, I created C:\SoapUIResponses/test.html...

    In MOCK response step configuration, I configured path as /SoapUIResponses/test.html too.....

    but when I run, test.html file is not enhanced.....
    May be I forgot somethings ?

    Aber29
  • Hi,

    the TestCase in the attached project doesn't seem to contain any MockResponse TestSteps, did you attach the right project?

    regards!

    /Ole
    eviware.com
  • abers29's avatar
    abers29
    Occasional Contributor
    Hi,

    yes, there is a MockResponse step within my project whose name is "OnTelephonicStateChanged" ....

    abers29