Jyoungfl
15 years agoOccasional Contributor
DDT Testing
Hello,
I just recently designed a set of scripts to verify the correct properties of one of our application installers. I'm using the DDT as way to verify a list of files and their internal versions.
I am experiencing two issues with the DDT object with Excel.
1. " Error: The connection for viewing your linked Microsoft Excel worksheet was lost." This was working the entire time I was writing the scripts. It occured a couple of time while I had the sheet open and it recovered it's self on the next attempt. However now its to a point it will not reconnect.
2. Using the Excel Spread sheet I am passing in the path of the file from column 0 and the version number in column 2. But when aqFileSystem["GetFileInfo"] is called it posts an error "Cannot open specified file." I have stepped it through to make sure the variable is being filled correctly from the DDT and spread sheet.
If I copy the path value directly from the spread sheet and hard code it in place of the DDT Object it works.
"fileName =Driver.Value(0);" (Variable is filled correctly "C:\\PathToFile\\FileName", but fails in the aqFileSystem object)
fileName ="\\PathToFile\file" (This works every time when hard coded.)
Verify_File_Versions ()
I just recently designed a set of scripts to verify the correct properties of one of our application installers. I'm using the DDT as way to verify a list of files and their internal versions.
I am experiencing two issues with the DDT object with Excel.
1. " Error: The connection for viewing your linked Microsoft Excel worksheet was lost." This was working the entire time I was writing the scripts. It occured a couple of time while I had the sheet open and it recovered it's self on the next attempt. However now its to a point it will not reconnect.
2. Using the Excel Spread sheet I am passing in the path of the file from column 0 and the version number in column 2. But when aqFileSystem["GetFileInfo"] is called it posts an error "Cannot open specified file." I have stepped it through to make sure the variable is being filled correctly from the DDT and spread sheet.
If I copy the path value directly from the spread sheet and hard code it in place of the DDT Object it works.
"fileName =Driver.Value(0);" (Variable is filled correctly "C:\\PathToFile\\FileName", but fails in the aqFileSystem object)
fileName ="\\PathToFile\file" (This works every time when hard coded.)
function Verify_File_Versions ()
Verify_File_Versions ()
{
var Driver = DDT["ExcelDriver"]("U:\\Source\\XperCon_Suite\\Installer\\DDTFiles\\XperConFileList.xlsx", "Sheet2",true);
var errCount = 0;
var fileVer, fileName;
while (!Driver.EOF())
{
fileName =Driver.Value(0);
fileVer = Driver.Value(1)
fileVerInfo = aqFileSystem["GetFileInfo"](fileName)["VersionInfo"];
verInfo = (fileVerInfo["FileMajorVersion"] +"." + fileVerInfo["FileMinorVersion"]+"." + fileVerInfo["FileBuildVersion"]+"." + fileVerInfo["FileRevisionVersion"]);
if (!fileVer == verInfo)
{
Log.Error("File Versions Mis-match Found " +fileName)
errCount = (errCount + 1)
}
Driver["Next"]();
}
if (!errCount == 0)
{
Log.Error("File Verison Check Failed.")
}
else Log["Message"]("File version Check Passed");
}