cancel
Showing results for 
Search instead for 
Did you mean: 

How to control MockResponse added as a TestStep

Highlighted
Frequent Contributor

How to control MockResponse added as a TestStep

Hello guys,

 

I know that mockResponse when added in test step, it will listen till a request is hit . However, is there a way it listens and still control move to next testStep in same testCase ?

12 REPLIES 12
Highlighted
Community Hero

Re: How to control MockResponse added as a TestStep

Could not understand what you looking for. can you describe it little more probably with an example?


Regards,
Rao.
Highlighted
Frequent Contributor

Re: How to control MockResponse added as a TestStep

Hi Rao,

 

I have RequestA triggered to server which will inturn  invoke RequestB and get ResponseB and then hit RequestC and get ResponseC.

I have created a testCase to include first RequestA and then followed by mockResponseB and mockResponseC testSteps. I am using mock URL in server property.xml. The Problem is here when I am running the project on commandline:

 

When I run testrunner followed by project, RequestA is submitted to server. Before the control go to start mockResponseB testStep, our server is hitting RequestB due to which we are getting ResponseB as unavailable.

 

So I need a way to start mockresponseB and mockResponseC to start listening first and then submit RequestA. All I need in one testCase only.

Highlighted
Community Hero

Re: How to control MockResponse added as a TestStep

Thank you for details. Can you clarify below?
1. Are all the operations of same service if you are using SOAP requests? clarify otherwise.

2. How are you starting mock services? In any setup script? Test suite or Test case or Project?


Regards,
Rao.
Highlighted
Frequent Contributor

Re: How to control MockResponse added as a TestStep

Hi, for 1) All operations belong to different service. For 2) I want to include all mock response within test case as test steps so that whenever control reaches mock response test step, it starts listening.
Highlighted
Community Hero

Re: How to control MockResponse added as a TestStep

Looks there is misunderstanding w.r.t #2 and as mentioned earlier, mockservice should start as part of setup script.


Regards,
Rao.
Highlighted
Frequent Contributor

Re: How to control MockResponse added as a TestStep

Hi Rao, thnx for reply. I am confused why mock response need to start with setup script? Can u explain please? Can't I try with adding mock response test step?
Highlighted
Community Hero

Re: How to control MockResponse added as a TestStep

Because, the mock service should be running so that it can respond to the call made in the test case.


Regards,
Rao.
Highlighted
Frequent Contributor

Re: How to control MockResponse added as a TestStep

Yes, but we can also add mock response as test step which is my scenario. I need to know if I can continue in test case execution provided mock response is still listening.
Highlighted
Community Hero

Re: How to control MockResponse added as a TestStep

I just heard it first time about the test step type, so can't comment about it without knowing its use cases.
So, are you sure that your use case can't be achieved without this step i.e., using mock service?


Regards,
Rao.
New Here?
Join us and watch the welcome video:
Top Kudoed Authors