Service Virtualization

 View Only
Expand all | Collapse all

Get request data from Excel for VS request and throw corresponding response

  • 1.  Get request data from Excel for VS request and throw corresponding response

    Posted Jul 14, 2016 02:38 AM

    Hello All,

     

    I have got DevTest 9.1. Could anyone please guide me on how to implement the approach, where i want to take the multiple request parameters from the excel and after matching, throw the response XML, in the corresponding row of the same excel?

     

    Earlier I had DevTest 8.4 version with which this could not be achieved.

    Please refer the below thread:

    https://communities.ca.com/thread/241753107

     

    Please suggest.

     

    Regards,

    Aman Saeed



  • 2.  Re: Get request data from Excel for VS request and throw corresponding response
    Best Answer

    Posted Jul 14, 2016 08:16 AM

    Here are some places to look to get you started:

    Data-Driven Virtual Services - DevTest Solutions - 9.1 - CA Technologies Documentation 

    Examples of Data-Driven Virtual Services - DevTest Solutions - 9.1 - CA Technologies Documentation

    Performance Tuning of Data-Driven Virtual Services - DevTest Solutions - 9.1 - CA Technologies Documentation

     

    From DevTest Portal, you can open a sample service that demonstrates DDVS.  The LISA_HOME/Projects/Bank_v5 and Bank_v6 directories contain sample projects.   The Bank_v5 shows a REST example and Bank_v6 shows a SOAP/HTTP example.   There is a test case in the Tests directory that will execute the service so you can see how it operates.

     

    EDIT: 

    There is a Data directory in the LH/Projects/Bank_v5 or v6 project that contains the Excel spreadsheet that is consumed by the service.  One thing to consider is that your dataset columns are expected to match the request argument list.  So far as I know, there is no concept of excluding an incoming request argument value during the look up query.  In other words, if your incoming request has 10 arguments on the signature, the spreadsheet is expected to have 10 columns (1 corresponding to each argument) to support the query.  Within 9.1, there are no configurations that allow one to specify which arguments to use when creating the select query.  All of them are used; therefore, you may need to use other DPHs like RDM if you need variation.



  • 3.  Re: Get request data from Excel for VS request and throw corresponding response

    Posted Jul 15, 2016 02:10 AM

    Hi J_NeSmith,

     

    Thanks for sharing the info. However i couldn't find the step where we are providing the path for the excel to be used.

    Could you please let know where/at which step in VSM are we mentioning the path for the excel.

     

    Regards,

    Aman Saeed



  • 4.  Re: Get request data from Excel for VS request and throw corresponding response

    Posted Jul 15, 2016 10:14 AM

    The pointer to the DDVS dataset is actually buried in the VSI.  So, technically, the step is the VSI Selection Step.  But, the dataset is not actually "inside" the VSM. 

     

    You may get an error when opening the DDVS VSM within Workstation. This seems to be because the dataset does not always resolve correctly within Workstation.  It should not affect your ability to open the VSM. 

     

    However, you will not see the dataset exposed as a property.



  • 5.  Re: Get request data from Excel for VS request and throw corresponding response

    Posted Jul 19, 2016 10:43 AM

    Hi J_NeSmith,

     

    I tried implementing this DDM approach. However I am facing several issues listed below.

     

    1) Unable to see the list of request tags (mentioned in the excel) & the response, in the drop down in the DevTest console. --> Image 2 & 3

    2) Excel (.xlsx) file is getting corrupted if I am trying to edit and upload the same file again. --> Image 1Image 3.pngImage 2.pngImage 1.png

     

    Please advice.

     

    Regards,

    Aman Saeed.



  • 6.  Re: Get request data from Excel for VS request and throw corresponding response

    Posted Jul 19, 2016 04:29 PM

    When using the DDVS service generated from within the portal, each argument on the incoming request is considered a matching element (column in your dataset).  The where clause that is constructed is similar to WHERE this = *** AND that = yyy and so on.

    In terms of editing the Excel spreadsheet, I have not seen the file become corrupted.  I am not saying it cannot happen.  I simply have not seen that scenario.



  • 7.  Re: Get request data from Excel for VS request and throw corresponding response

    Posted Jul 20, 2016 03:00 AM

    Hi Joel, Thanks for your valuable guidance. However, i am still not able to see the options in the drop down for matching, after importing the excel. I would try to give this a spin and let you know in case I face any issues. Thanks!!! Regards, Aman Saeed



  • 8.  Re: Get request data from Excel for VS request and throw corresponding response

    Posted Dec 15, 2016 03:02 AM

    Hi ,

     

    can anyone please help me to implement the same which (Aman had mentioned" using DevTest Workstation instead of portal.

     

    With regards,

     

    Akshay A



  • 9.  Re: Get request data from Excel for VS request and throw corresponding response

    Posted Dec 16, 2016 03:23 AM

    From what I have learnt, You will need to script it in your .vsi file under "match script" for that particular R/R pairing. 



  • 10.  Re: Get request data from Excel for VS request and throw corresponding response

    Posted Dec 16, 2016 12:07 PM

    You can find Data Driven Virtualization jar file in community or ask CA team to provide.Jar files provide custom step to make connection with external Data Source (Excel/Database). You can use that object in your match script to create property with external source values and use those in your response.

     

    Do let me know , if you need any help with Match Script.

     

    Regards,

    -Ankush Sharma



  • 11.  Re: Get request data from Excel for VS request and throw corresponding response

    Posted Dec 16, 2016 12:10 PM