How to reset numeric counting dataset ?
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:
// 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
As stated, no guarantees either approach will work.
Maybe someone else will chime in with additional alternatives.
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
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");
Great it got worked, it is only a typo.
Bharath2262 - did Joel's response answer your question? If so, please be sure to mark it as correct.