Service Virtualization

  • 1.  Virtualization of Soap Request with Dynamic response with LISA (9.5.1.6)

    Posted Jun 14, 2017 02:03 AM

     

     

     

    is there any way to write code to loop on number of  tags and give the same number of tag in response.?

    here we don't know how many    tags coming in request so we cant write matchscript and map any particular response.

    how would lisa identify the no of  different and give the same number of tags in response.????????

    Thanks in advance!!



  • 2.  Re: Virtualization of Soap Request with Dynamic response with LISA (9.5.1.6)

    Posted Jun 14, 2017 10:13 PM

    Hi Karthik,

     

    A pretty straight forward solution.

    Say you need dynamic responses upto 10 <availabilityRequestDetail> from request

     

    1.Create 10 RR Pairs with each <availabilityRequestDetail>.

    Meaning the first RR Pair has 1 <availabilityRequestDetail>. Second has 2 and so on and create VS.

     

    2.Using the Signature Match establish the mapping of the request to the response.

    This will ensure that particular response matching Request Node count is sent.

     

    3.Convince testing teams that this can be tested only upto 10 Request Details. Guess for testing purpose it should do.

    We had a similar situation and this worked.

     

    Hope it helps.

     

    Regards,

    Barath.



  • 3.  Re: Virtualization of Soap Request with Dynamic response with LISA (9.5.1.6)
    Best Answer

    Posted Jun 19, 2017 05:50 AM

    Hi kartik.audichya,

     

    1. get the count of sku entries using xpath count function and store it in filter say total

    2. create a property and assign it to 0, say count

    3. read the count value and compare if it is less than total. if yes increment it and if no go to step 8

    4. for the current value of count read the required  values using xpath and store them in filters. say ((sku)) , {{location}} 

    5. use parse text as response step and frame an xml tag using the filter values, like below

        <availabilityResponseDetail xmlns="">
                <sku>{{sku}}</sku>
                <location>{{location}}</location>
                <isOpenBox>{{filter value}}</isOpenBox>
                <availableQuantity>1000000</availableQuantity>
                <rank>1</rank>
                <floor>10</floor>
                <advertiseMinimum>10</advertiseMinimum>
             </availabilityResponseDetail>

    6. store this response to a file (append mode) and loop back to count value comparison step(step 3)

    7. repeat step 3 to step 6 until all the sku entries as read and stored for response

    8. read the file stored as property and create a full response. like below

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <soapenv:Body>
          <availabilityResponseMessage xmlns="http://bestbuy.com/InventoryManagement">
          {{availability_response_details_read_from_file}}


          </availabilityResponseMessage>
       </soapenv:Body>
    </soapenv:Envelope>

     

    Try these and let me know if it helps.

     

    Thanks,

    Venkatesh



  • 4.  Re: Virtualization of Soap Request with Dynamic response with LISA (9.5.1.6)

    Posted Jun 27, 2017 03:24 PM

    Hi Kartik,

     

    Did Venkatesh's last response help you out with this issue?