Service Virtualization

  • 1.  Read some rows from excel dataset in vsm

    Posted Jul 17, 2018 07:10 AM

    Hi,

     

    I am trying read some rows from excel dataset to populate the response in vsi.

     

    I have added one excel dataset in vsm to read rows specified the count of rows and then forming the response and populating it in vsi.

     

    For one iteration it is working fine but for the next dataset counter is not resetting.

     

    For ex- if for 1st request i have given the count as 4 , then dataset will; read 4 values and formulate the response and display it vsi.

    but for next request i have given count as 10 , then data set is reading the values from 5th row not from the 1st row.

     

    Can anyone let me know why dataset is not reading it from 1st for every new request to vs ?

     

    Thanks



  • 2.  Re: Read some rows from excel dataset in vsm

    Posted Jul 17, 2018 08:11 AM

    Hi,

     

    I assume you doing this for HTTP WebService, try below:

     

    Create a sub-process after you read the "count" value at HTTP Listener step. Use this sub-process to read the data from excel , also do a check on "Local' checkbox in the DataSet(read rows from Excel file)

     

    Hope it helps.

     

    Regards,

    Dinesh Kumar



  • 3.  Re: Read some rows from excel dataset in vsm
    Best Answer

    Posted Jul 17, 2018 02:53 PM

    In most cases, datasets are used in a For Loop where indexing occurs from 1 by 1 until the dataset is exhausted at which time the test takes some action. The requirement you describe is that each Request must iterate over the data starting at the first row in the dataset.

    The model, as seen in DevTest Workstation, is logical in that it does not depict the run-time implementation of Virtual Services and the objects that support the execution of the service.

    DevTest implements an advanced virtual service threading model for performance reasons. As a result, DevTest does not always completely destroy the object that wraps the execution of the steps within the VSM; hence, some aspects of properties and dataset state may be there from one request to the next.

    Because these objects are reused (i.e., not destroyed between requests/responses), there is always the potential for objects to maintain some amount of leftover state. I suspect that is what is happening in this situation.

    I cannot say with certainty that the links below will solve the issue, but check out:

    Resetting numeric counting dataset 

    In one of my testcases, I need to loop a web service execution test step for a particular request 5 times and when it hits 6th time i need to go to different step. Can someone help me in this. 

    Reloading Data Set