I need to setup multiple responses for a REST based VS.
The URI would be same all the time. eg: GET /v1/color/data/colors/123456
We are not sending any other content in the request. Each time the above URI is called, the VS has to send a different response.
could anyone help me on this?
Hi madhudeva, given the URI information, above, the '123456' value looks like it could be made into a URLPARAM such that you could provide responses for different colors.
However, to your question, check out the Allow Duplicate Specific Transactions options in the Transaction Basics tab.
Here's a link: Transactions Tab for Stateless Transactions - DevTest Solutions - 9.1 - CA Technologies Documentation
This feature enables multiple specific transactions for the same request (in the VSI). During playback the responses are sequentially chosen from the list of specific transactions. Copy / paste your specific transaction and change the response according to your requirement. Check the Allow Dup Spec Txns box, deploy, and try your service.
The responses will round robin starting with the first and moving to the next txn. When the list is exhausted, the 'loop' will start over with the first txn.
Similarly, if you record your transactions, enable Allow Duplicate Specific Transactions in the Recorder and the resulting VSI will contain your duplicate transactions. I apply this setting in the recorder when I record a system for the first time, and I do not know the application behavior. Sometime, it exposes a scenario that I did not know about.
Thankyou Joel. Allow dup specific transactions option worked fine.