Forum Discussion
AlexeyKolosov
Staff
15 years agoHi,
Here is the script that counts the total number of errors:
function GetTotalErrorNumber()
{
var tempFolder = aqEnvironment.GetEnvironmentVariable("temp") + "\\" + Math.floor(Math.random() * 10000) + "\\";
aqFileSystem.CreateFolder(tempFolder);
Log.SaveResultsAs(tempFolder, lsXML);
var xDoc = Sys.OleObject("MSXML2.DOMDocument.4.0");
xDoc.load(tempFolder + "Description.tcLog");
var errC = VarToInteger(xDoc.selectSingleNode('Nodes/Node[@name="root"]/Prp[@name="error count"]/@value').text);
aqFileSystem.DeleteFolder(tempFolder, true);
return errC;
}
function PostSum()
{
Log.Message("Error count: " + GetTotalErrorNumber());
}
Note that you need to get the total number of errors using the GetTotalErrorNumber function in a routine (in this case, it is PostSum) set as the last test item of the project.