Service Virtualization

  • 1.  How to handle List element values in Extact Matching

    Posted Nov 28, 2017 04:25 PM

    In our project we need to virtualize service with message with list of cities. There is no guarantee that  cities order will be in similar order.

     

    Example:  Request 1:  <cities>

                         <city>test1</city>

                         <city>test2</city>

                         <city>test3</city>

             <cities>

     

    Request 2:  <cities>

                         <city>test1</city>

                         <city>test3</city>

                         <city>test2</city>

             <cities>

     

    In DevTest both the request are treated as two transactions. However the response going to same. How to instruct DeeTest both the requests are same.

     

    DevTest Version 9.0

     



  • 2.  Re: How to handle List element values in Extact Matching

    Posted Nov 28, 2017 04:31 PM

    Hi,

         Why not set the match tolerance to operation in VSI?

    Thanks,

    Vish



  • 3.  Re: How to handle List element values in Extact Matching

    Posted Nov 28, 2017 04:34 PM

    We need to validate the all the elements and value for our virtualization. SO we need to use Exact mode.



  • 4.  Re: How to handle List element values in Extact Matching

    Posted Nov 28, 2017 04:38 PM

    Hi,

         Sorry,if the  match tolerance of exact is a mandate,set the comparsion operator under Request Data section of VSI to approriate regular expression.

    Thanks,

    Vish



  • 5.  Re: How to handle List element values in Extact Matching

    Posted Nov 28, 2017 04:41 PM

    Hi,

     

    We can use match script to validate as per custom requirement and return true if all satisfies:

     

    lisa_vse_request.getArguments("cities_city_1");

    and so on.....

    .

    .

    above can give you required values from request and same can be validated with pre-defined values.

     

    Thanks,

    Dinesh Kumar



  • 6.  Re: How to handle List element values in Extact Matching
    Best Answer

    Posted Nov 28, 2017 11:21 PM

    This would require some custom development by either creating a custom data protocol handler or using match script.

     

    I suggest you order the array/list elements alphabetically by their content values and then compare it to the expected list of values.