Forum Discussion
Hi Nick,
Thank you for the quick reply. You are right when I create the spreadsheet manually, TestComplete does ready the value 0. But I realized, the spreadsheet I am using is generated by the application I am testing, for some reason when I run the same script, TestComplete doesn't read the value 0 and Difference is set to undefined. But if I resave the same spreadsheet as it is, TestComplete does read the value 0. This is so weird, I am not really sure what to do. Any help would be appreciated.
Thanks,
Hina
Hey hina,
Interesting, maybe it's some type of odd formatting that is being applied. Would it be possible for you to attach a copy of the spreadsheet that is generated by your application?
- hina3 years agoContributor
Hi Nick,
I have attached the file generated by the application, which Testcomplete can't read.
Also I tried one more thing, I modified the code to add excelFile["Save"](); (was hoping it might fix the issue)
Below is the code:
function VerifyQueryResults(ExcelFileName)
{
// Get the sheet of the Excel file
var excelFile = Excel.Open(ExcelFileName);
var excelSheet = excelFile.SheetByTitle("Sheet1");
Delay(1000);
excelFile["Save"]();
// Read data from the Excel file
var Difference = excelSheet.Cell(1, 2).Value;
if(Difference == 0)
Log["Event"]("Expected and Actual Datasets are the same");
else
Log["Error"]("Expected and Actual Datasets are not the same");
}But when I run the code above, Testcomplete throws an error below:
Next time when I run the same code, TestComplete throws an error below:
So basically excelFile["Save"](); does not work.
Thanks,
Hina
Related Content
- 2 years ago
- 2 years ago
Recent Discussions
- 2 days ago