cancel
Showing results for 
Search instead for 
Did you mean: 

Get data from previous step in virtual service (mock)

SOLVED
Occasional Contributor

Get data from previous step in virtual service (mock)

Hi,
I have a GET REST service "https://intracomp.se/v1/state/${Properties 1#agreementId}/${StateDate#result}/tree". As you can see the service uses some properties from the previous test steps.
My question is how can I (if possible) achive this when I use virtual service. I am still running the whole test case and I would like to, depending on the value of the propertie from previous step, return different JSON messages.
But If I only can start a listener on http://localhost:8080 and not add any parameters after that then I can not differentiate the request.

I.e. I would like to write "http://localhost:8080/v1/state/${Properties 1#agreementId}/${StateDate#result}/tree". But I cannot get this to work.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: Get data from previous step in virtual service (mock)

Hi,

 

If I got your question right, you are using SoapUI for testing and would like that some request(s) are processed by ServiceV but not by the real server.

If the above understanding is correct, then I can think of two options:

a) Change the endpoint address for the required request so that SoapUI send it to the ServiceV instead of the real server;

b) If for some reason the above is not possible, you may consider using the conditional routing functionality of ServiceV - https://support.smartbear.com/readyapi/docs/servicev/routing/conditional.html

 

Does this help?

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
2 REPLIES 2
Community Hero

Re: Get data from previous step in virtual service (mock)

Hi,

 

If I got your question right, you are using SoapUI for testing and would like that some request(s) are processed by ServiceV but not by the real server.

If the above understanding is correct, then I can think of two options:

a) Change the endpoint address for the required request so that SoapUI send it to the ServiceV instead of the real server;

b) If for some reason the above is not possible, you may consider using the conditional routing functionality of ServiceV - https://support.smartbear.com/readyapi/docs/servicev/routing/conditional.html

 

Does this help?

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Occasional Contributor

Re: Get data from previous step in virtual service (mock)

Thanks Alex,
Solution a) wokred.
A bit strange since I did test this but It must have been something else that was wrong at that time as well so it did not work. But sure it works. Thank you

New Here?
Join us and watch the welcome video:
Join the Online Event to Win
Top Kudoed Authors