Service Virtualization

 View Only
  • 1.  Resetting numeric counting dataset

    Posted May 04, 2016 07:54 PM

    How to reset numeric counting dataset ?



  • 2.  Re: Resetting numeric counting dataset
    Best Answer

    Posted May 04, 2016 09:34 PM

    This might be tricky depending on how your test case and dataset are being used. 

    Here are a couple of approaches that you might try.  No guarantee which, if any of these approaches, will work.

     

    1) If you can move your dataset into a subprocess, the dataset should reset each time the subprocess is invoked.  Unclear if your test case would support this or not.

     

    2) You could try to add a script step to reset the dataset.  For example:

    import com.itko.lisa.test.DataSet;

    import.com.itko.lisa.test.DataSetManager;

    // find the dataset by sending instance of testExec and string name of your dataset to findDataset

    DataSet ds = DataSetManager.findDataset(testExec, "<name of your ds here>");

    // send a reset command to the dataset

    ds.reset();

    return true;

    As stated, no guarantees either approach will work.

    Maybe someone else will chime in with additional alternatives.



  • 3.  Re: Resetting numeric counting dataset

    Posted Jul 29, 2018 08:57 AM

    Hi Joel,

     

    i have tried but no it is throwing below error,

     

    Message: bsh.EvalError: Sourced file: inline evaluation of: ``import com.itko.lisa.test.DataSet; import com.itko.lisa.test.DataSetManager; . . . '' : Typed variable declaration : Error in method invocation: Static method findDataset(com.itko.lisa.test.TestExec, java.lang.String) not found in class'com.itko.lisa.test.DataSetManager' : at Line: 7 : in file: inline evaluation of: ``import com.itko.lisa.test.DataSet; import com.itko.lisa.test.DataSetManager; . . . '' : DataSetManager .findDataset ( testExec , "CDS" )
    in inline evaluation of: ``import com.itko.lisa.test.DataSet; import com.itko.lisa.test.DataSetManager; . . . '' at line number 7

     

    Best Regards,

    Venkata Yedida  



  • 4.  Re: Resetting numeric counting dataset

    Posted Jul 30, 2018 08:29 AM

    There seems to be a typo in the original code. Try using a capital "S" in findDataSet( te, string).  E.g.,     

    DataSet ds = DataSetManager.findDataSet( testExec, "CDS"); 



  • 5.  Re: Resetting numeric counting dataset

    Posted Jul 30, 2018 09:06 AM

    Hi Joel,

     

    Great it got worked, it is only a typo.

     

    Best Regards,

    Venkata Yedida 



  • 6.  Re: Resetting numeric counting dataset

    Posted May 16, 2016 04:56 PM

    Bharath2262  - did Joel's response answer your question? If so, please be sure to mark it as correct.