akalogeropoulos
10 years agoOccasional Contributor
Unexpected character in query string in msxml4.dll
I copie the code I found in the smartbear community. Everytime I execute the keywordtest and then i run the function "getInformationData()", so i could retrieve warning /error count and the time it took to execute the test.
Error message:
Unexpected character in query string.
Nodes/Node[@na--><--me="root"]/Prp[@name="warning count"]/@value
Here is the code JScript :
function getInformationData() { //var tempFolder = aqEnvironment.GetEnvironmentVariable("temp") + "\\" + Math.floor(Math.random() * 10000) + "\\"; var tempFolder = aqEnvironment.GetEnvironmentVariable("temp") + "\\testXML\\"; aqFileSystem.CreateFolder(tempFolder); Log.SaveResultsAs(tempFolder, lsXML); var xDoc = Sys.OleObject("MSXML2.DOMDocument.4.0"); xDoc.load(tempFolder + "Description.tcLog"); Log.Message(xDoc.xml); // Warning count var wrnC = VarToInteger(xDoc.selectSingleNode('Nodes/Node[@name="root"]/Prp[@name="warning count"]/@value').text); //var wrnC = VarToInteger(xDoc.selectSingleNode('Nodes/Node[@name="root"]/Prp[@name="warning test count"]/@value').text); //Error count var errC = VarToInteger(xDoc.selectSingleNode('Nodes/Node[@name="root"]/Prp[@name="error count"]/@value').text); //var errC = VarToInteger(xDoc.selectSingleNode('Nodes/Node[@name="root"]/Prp[@name="error test count"]/@value').text); //Execution time var startTime = VarToFloat(xDoc.selectSingleNode('Nodes/Node[@name="root"]/Prp[@name="start time"]/@value').text); var stopTime = VarToFloat(xDoc.selectSingleNode('Nodes/Node[@name="root"]/Prp[@name="stop time"]/@value').text); aqFileSystem.DeleteFolder(tempFolder, true); var res = "Errors: " + errC + "\r\n" + "Warnings: " + wrnC + "\r\n" + "Start Time: " + DateTimeToStr(startTime) + "\r\n" + "Stop Time: " + DateTimeToStr(stopTime) + "\r\n" + "Run Time: " + aqConvert.DateTimeToFormatStr(stopTime - startTime, "%H:%M:%S"); Log.Message(res); //return res;
Best reagrds,
Anastasios Kalogeropoulos