I have test scripts (mostly Javascript) that reads the first row of a .tsv file to set parameters in my application. These parameters determine the data to be displayed within the application. I have a second .tsv file that contains the same data as the table in my application. I then compare the second data file to the table data to make sure the values are correct. This all works correctly but it requires me to have multiple data files for every different set of parameters, could be upwards of 800 files. My display tables are always 3 by 10. I would like to put all the table data in one file. In other words read the first row of the parameter file, compare the first 3 by 10 set of data, read line 2 of the parameter file and compare it to the second 3 by 10 set of data.
The code is as follows;
testData.put("import.tsv");
var set = testData.dataset("import.tsv");
for(var pv_data in set){
format = testData.field(set[pv_data], "Format") ;
name = testData.field(set[pv_data], "Name") ;
btflag = testData.field(set[pv_data], "BT Flag") ;
xaxis = testData.field(set[pv_data], "X-axis") ;
yaxis = testData.field(set[pv_data], "Y-axis") ;
slice1 = testData.field(set[pv_data], "Slice1") ;
slice2 = testData.field(set[pv_data], "Slice2") ;
slice3 = testData.field(set[pv_data], "Slice3") ;
file = testData.field(set[pv_data], "File") ;
//code that calls the above variables omitted
for ( i = 0; i<=2; i++)
{
runTest = true ;
// Verification Point 'VP1'
//the variable "file" reads a file with the data
testData.put(file);
var dataSet = testData.dataset(file);
for (var numRow in dataSet)
{
table = findObject(":MainWindow.QHBox1.QWorkspace1.Model View.VMSMain.vmsStack.VMSViewAssumptions.mainFrame.pageFrame.assumptionTabWidget.tab pages.dataTab.dataDisplayTable");
cell = table.item(numRow, i);
var compare = cell.text();
print ("this is compare " + compare);
var data = testData.field(dataSet[numRow], i) ;
test.compare(compare, data);
runTest = false;
}
}
}
Thanks in advance for any help...
The code is as follows;
testData.put("import.tsv");
var set = testData.dataset("import.tsv");
for(var pv_data in set){
format = testData.field(set[pv_data], "Format") ;
name = testData.field(set[pv_data], "Name") ;
btflag = testData.field(set[pv_data], "BT Flag") ;
xaxis = testData.field(set[pv_data], "X-axis") ;
yaxis = testData.field(set[pv_data], "Y-axis") ;
slice1 = testData.field(set[pv_data], "Slice1") ;
slice2 = testData.field(set[pv_data], "Slice2") ;
slice3 = testData.field(set[pv_data], "Slice3") ;
file = testData.field(set[pv_data], "File") ;
//code that calls the above variables omitted
for ( i = 0; i<=2; i++)
{
runTest = true ;
// Verification Point 'VP1'
//the variable "file" reads a file with the data
testData.put(file);
var dataSet = testData.dataset(file);
for (var numRow in dataSet)
{
table = findObject(":MainWindow.QHBox1.QWorkspace1.Model View.VMSMain.vmsStack.VMSViewAssumptions.mainFrame.pageFrame.assumptionTabWidget.tab pages.dataTab.dataDisplayTable");
cell = table.item(numRow, i);
var compare = cell.text();
print ("this is compare " + compare);
var data = testData.field(dataSet[numRow], i) ;
test.compare(compare, data);
runTest = false;
}
}
}
Thanks in advance for any help...