Service Virtualization

Expand all | Collapse all

Problem while reading Attribute in LISa Request

Jump to Best Answer
  • 1.  Problem while reading Attribute in LISa Request

    Posted 04-19-2018 08:55 AM

    In Lisa, How to Read Attribute Value in the Request while creating a project.

    Sample Request:

    <request>
        <provider_specifics>
        <provider_data param_name="product">ABC</provider_data>   

    <provider_data param_name="code">xyz</provider_data>   
       </provider_specifics>
    </request>

    In Request I want read tag with param_name attribute value to differentiate both the Tags .



  • 2.  Re: Problem while reading Attribute in LISa Request

    Posted 04-19-2018 08:56 AM

    Doing Virtualization... please help me to find the solution



  • 3.  Re: Problem while reading Attribute in LISa Request

    Posted 04-19-2018 10:16 AM

    DevTest provides Generic XML Payload Parser DPH to handle your need.

     

    Appropriate XML Xpath expression would need to be used in this DPH to extract different request arguments.

     

    https://docops.ca.com/devtest-solutions/10-3/en/using/using-ca-service-virtualization/using-devtest-workstation-with-ca-service-virtualization/creating-service-images/using-data-protocols/generic-xml-payload-parser-data-protocol

     

    E.g. following Xpath can be used to set an argument which has a value of ABC

     

    /request/provider_specifics/provider_data[@param_name='product']/text()



  • 4.  Re: Problem while reading Attribute in LISa Request
    Best Answer

    Posted 04-19-2018 09:43 AM

    You add the "Request Data Manager" Data Protocol Handler during recording. You select the request, and you add a new rule. You want to copy from an attribute. Select the "param_name" attribute and press the "Source" button. Copy it to an argument. You then have param_name as an argument, with "product" or "code" as the value, as appropriate.



  • 5.  Re: Problem while reading Attribute in LISa Request

    Posted 04-23-2018 02:49 AM

     

    How to enable Source button in this image?



  • 6.  Re: Problem while reading Attribute in LISa Request

    Posted 04-23-2018 03:40 AM

    Click on the piece in the request that you want to be the source, and the source button is enabled. I don't understand why your whole request is just an operation, though, or how come that operation is an XML element.