Hey Allen,
I have one more doubt.The code below to compare two excel files compares only a single worksheet.If we need to verify two excel files each with 3-4 worksheets that both of them have same worksheets ,then how to loop around to verify each worksheet in one file against each in another file. Can you please suggest me how to write a loop for multiple worksheet verification in jscript.
Thanks,
Sumedha
function ExcelCompare(file1,file2,sheet)
ExcelCompare(file1,file2,sheet)
{
var TestRecordSet = DDT.ExcelDriver(file1,sheet);
TestRecordSet = .ExcelDriver(file1,sheet);
var BaseRecordSet = DDT.ExcelDriver(file2,sheet);
BaseRecordSet = .ExcelDriver(file2,sheet);
while (! TestRecordSet.EOF() && ! BaseRecordSet.EOF())
(! TestRecordSet.EOF() && ! BaseRecordSet.EOF())
{
for (i = 0; i < DDT.CurrentDriver.ColumnCount; i++)
{
if (!(TestRecordSet.Value(i)== BaseRecordSet.Value(i)))
Log.Warning("The value in column" + TestRecordSet.ColumnName(i) + "does not match the expected value");
}
TestRecordSet.Next(); // Goes to the next record
BaseRecordSet.Next(); // Goes to the next record
}
return true;
;
}