Service Virtualization

Expand all | Collapse all

I need to setup Multiple responses for a REST step in virtual service

Jump to Best Answer
  • 1.  I need to setup Multiple responses for a REST step in virtual service

    Posted 04-22-2016 01:39 PM

    Hi All

     

    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?

     

    Regards

    Madhu. D



  • 2.  Re: I need to setup Multiple responses for a REST step in virtual service
    Best Answer

    Posted 04-25-2016 10:06 AM

    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.



  • 3.  Re: I need to setup Multiple responses for a REST step in virtual service

    Posted 04-25-2016 06:24 PM

    Thankyou Joel. Allow dup specific transactions option worked fine.