Service Virtualization

  • 1.  Filters and Assertions

    Posted Mar 15, 2017 12:03 PM

    I had a array in the following way which i got after applying the JSON filter , is there any way i get  only the distinct values of array from filter or assertion.

     

    Or is there any way i can split this into different indiviual units like data[0],data[1],data[2] etc ....

     

    ["UF-1","UUF-1","TF-1","TF1","TF1",""SGS-2F","TF-1","LS-2F","TF-1","LS-2F","TF-2","LS-2F","TF-1","TF-2","TUF-1"]



  • 2.  Re: Filters and Assertions

    Broadcom Employee
    Posted Mar 15, 2017 01:09 PM

    You should be able to either iterate over your json filter by using subscript [0] , [1] etc instead of using * after finding the length of the array

    or

    use {{data=<property_name>.split(",")}} to get individual tokens - where <property_name> is the property which has the value of

    ["UF-1","UUF-1","TF-1","TF1","TF1",""SGS-2F","TF-1","LS-2F","TF-1","LS-2F","TF-2","LS-2F","TF-1","TF-2","TUF-1"]



  • 3.  Re: Filters and Assertions

    Posted Mar 15, 2017 01:59 PM

    But where we need to use {{data=<property_name>.split(",")}} in which filter we need to include this .? Not able to find where can split it ,

    I already create a propertyname called fl_srvc for 

    ["UF-1","UUF-1","TF-1","TF1","TF1",""SGS-2F","TF-1","LS-2F","TF-1","LS-2F","TF-2","LS-2F","TF-1","TF-2","TUF-1"]

    Got , yes we can write Subscript for it .



  • 4.  Re: Filters and Assertions

    Broadcom Employee
    Posted Apr 14, 2017 11:53 AM

    1. You can add {{data=fl_srvc.split(",")}} in the log message area of a step after fl_srvc has evaluated in ["UF-1","UUF-1","TF-1","TF1","TF1",""SGS-2F","TF-1","LS-2F","TF-1","LS-2F","TF-2","LS-2F","TF-1","TF-2","TUF-1"]

     

    2. You can add {{data=fl_srvc.split(",")}} in a "Parse text as response" step after fl_srvc has the comma delimited values

     



  • 5.  Re: Filters and Assertions

    Posted Apr 17, 2017 08:13 AM

    Did Prem's recommendations help you out regarding this issue?