Service Virtualization

  • 1.  Read a specific row from excel into datasets

    Posted Jul 16, 2018 03:33 AM

    Hi All,

    I am passing data to my test case using an excel sheet which has n rows.
    All the time, when I execute the test only the first row is considered.
    How to select a specific row data for execution and how to iterate the testcase on all the rows?
    Please help me with this query.



  • 2.  Re: Read a specific row from excel into datasets

    Broadcom Employee
    Posted Jul 16, 2018 09:09 AM

    Currently DevTest does not support reading a specific row from Excel, but there is an idea for it:

     

    Read specific excel rows 

     

    I did find where someone has a customization to do this which might help:

     

    Custom Dataset-Read Specific rows from excel file (Start Row - End Row) 



  • 3.  Re: Read a specific row from excel into datasets

    Posted Jul 16, 2018 09:58 AM

    Thank you Marcy



  • 4.  RE: Re: Read a specific row from excel into datasets

    Posted Jan 10, 2024 02:58 PM

    Hello Marcy,

    looks like above links are expired , is there any other place when I can go over this information ?

    I am trying to find solution for below question that i posted separately 

    I have virtual services where response is based on data set (read rows from excel). It is currently configured to fetch data for one particular account. Now I have a requirement to add another account where the data is different between these accounts. Can we compare the account number coming in request with the excel sheet and share appropriate response? 

    Thanks.

    Vikram 




  • 5.  RE: Re: Read a specific row from excel into datasets

    Broadcom Employee
    Posted Jan 10, 2024 03:16 PM
    Edited by Marcy Nunns Jan 10, 2024 05:30 PM

    Yes, I looked for it but cannot find it.  I suggest to re-post your use case and then we can research.  Apologies for the inconvenience.  Or just open a support case and we will work with you.

    ~Marcy




  • 6.  RE: Re: Read a specific row from excel into datasets

    Posted Jan 11, 2024 09:29 AM
    I have opened separate thread on this topic.

    Do we have an option for virtual services based on (read rows from excel), compare incoming fields with the data listed in excel, and share the appropriate response?

    Any inputs on this would be really helpful.

    Thanks,
    Vikram




  • 7.  Re: Read a specific row from excel into datasets
    Best Answer

    Posted Jul 16, 2018 09:42 AM

    DevTest supports the concept of iterating over Excel data, and, for each row in the spreadsheet, performing some action. This is done by setting up the Excel data as a Dataset and implementing a for loop.

    An example using a CSV dataset is shown in the LISA_HOME/examples/load-csv-dataset-web.tst Test Case. Generally, CSV formatted files are more performance oriented than Excel files.

    Bear in mind, DevTest does not open the Excel files using MS Excel; therefore, the extra content in the file (such as calculations, references, formulas, row, text and cell formatting, etc.) is just loud noise to DevTest which is only interested in the column data. 

    As MarcyNunns points out, some have created customizations that access Excel data in more dynamic ways.



  • 8.  Re: Read a specific row from excel into datasets

    Posted Jul 16, 2018 10:06 AM

    Thank you Joel . Is there any way that we can edit the key value of "Read Rows from Excel File_RowNum" in dataset properties?

    The value is always 1. Can we write any script to change the value?



  • 9.  Re: Read a specific row from excel into datasets

    Posted Jul 16, 2018 10:14 AM

    Can you upload an example so we can look at the test?

    I believe the value you are referring to is an output display that represents the row number processed by DevTest. I do not believe this value is used internally to control reading a specific row number in the file. In other words, attempting to use Test Exec to set this value in the test step does not cause the internal engine to jump to the row specified by the newly set value.