Service Virtualization

Expand all | Collapse all

How to handle decimal inputs in Request Data->Arguments after recording a http transaction

  • 1.  How to handle decimal inputs in Request Data->Arguments after recording a http transaction

    Posted Sep 21, 2017 04:01 PM

    Hello All,

    I was trying to mock a POST request (REST service) containing any decimal value in the json payload. Since the data is dynamic which can be either an integer value or a decimal value, what should be the comparison operator and value under the Request data.

    In my example, i used the Argument name having comparison operator as "Regular expression" and Value as "(\d+)". But the response is not matching and going as Meta response.



  • 2.  Re: How to handle decimal inputs in Request Data->Arguments after recording a http transaction
    Best Answer

    Posted Sep 21, 2017 06:19 PM

    Hello Balu,

     

    I am wondering if the no matching is happening because of the argument that is using the regular expression or a different argument.

    With the Workstation, there is a Regular Expression Helper that you can use to test the argument value with the expression you are using.

    You can also verify in the Inspection View what is not matching. This document contains some steps to use the Inspection View to debug no matching transactions.

    How do you use the Inspection View and options to help debugging VSE transactions. 

     

    Hope it helps.

    Heloisa



  • 3.  Re: How to handle decimal inputs in Request Data->Arguments after recording a http transaction

    Posted Sep 22, 2017 12:42 AM

    Thanks Maria. The issue was due to the regular expression. it worked fine with the Anything operation.