IDE & Navigation
Properties & Tools
»Model Editor Transition Context Menu: Trans DataSet
DataSet Editor allows you to create and edit the dataset for a transition. You can dynamically add or remove fields. It supports several combinatorial test generation algorithms including Pairwise algorithm. For more advanced data generation, please check out Data Designer.
A transition dataset is automatically used by TestOptimal in test generation. The rows in the dataset are retrieved and used as the transition is traversed. You can access the data fields on the current row with $getTransData('fieldName') in any of the transition triggers.
DataSet is automatically created when you open DataSet Editor through transition context menu Edit DataSet.
By default, fields are created to participate in the algorithm in generating test cases. You can create a field to store the verification result which you will use to record the expected value after executing the test case using the data on that row. To create a verification field, select V for Group attribute from the dropdown list.
Use the default (leave it blank) when creating non-verification field, which indicates that these fields are independent of each other.
In some cases a group of field may be related to each other and they must choose the related value from the list. For example if you have Credit Card Type and Credit Card Number fields added to the dataset and defined a list of credit card types like visa/amex/master/etc and the matching credit card number for each credit type, Credit Card Number must correspond to the matching Credit Card Type. In this case, select the same group id form Group attribute dropdown list for these fields.
By sharing the same group id, fields will take the values from their lists at the same position.
Once you have the fields defined, you can generate the dataset for the fields by clicking on the regenerate link.
If you have verification field(s), they will be left blank. You can enter the appropriate values for each row. The results will be saved if Persistence checkbox is checked.
During the model execution, the dataset will be loaded and traversed. Besides the option to traverse the datatable sequentially or randomly as described above, you can also control the sequence of which row to be used first programmatically in mScript by setting the user variable dataset name_idx.
DataTable can be sorted by clicking on the column label. You can sort by multiple columns by holding the SHIFT key while clicking on the column label.
You may also import dataset from external file (xsl, csv, jdbc database and url) and dataset you have created with DataDesigner.
To import data from external files, click on import link. Following dialog will appear:
The file extension is used to determine the file type:
Importing from a jdbc database requires that you have defined a system datasource first. Then you just enter the following URI:
sql:datasource=TestDB;sql=select * from employee
TestDB is the name of the system datasource to be used to run the
Importing from http data source can be set using the following URI:
where the http URL above is the url accessible from
TestOptimal server and returns a tab delimited file.
The import operation is a one time operation. Changes to the original data source will not be automatically updated to the dataset. You may force dataset to automatically refresh the data from the original data source before each model execution by checking the checkbox Auto Refresh. Be aware that should you have made any changes to the dataset after last import, those changes will be lost when refresh is completed.
To prevent such loss of changes, it is recommended to import data from dataset created with DataDesigner.